Switched event system (again)

This commit is contained in:
Ruud
2011-03-01 11:12:56 +01:00
parent fd5a41435b
commit f9523444f4
24 changed files with 580 additions and 142 deletions
+31 -1
View File
@@ -5,7 +5,37 @@ Block.Search = new Class({
create: function(){
var self = this;
self.el = new Element('div.search_form');
self.el = new Element('div.search_form').adopt(
self.input = new Element('input', {
'events': {
'keyup': self.autocomplete.bind(self)
}
})
);
},
autocomplete: function(){
var self = this;
if(self.autocomplete_timer) clearTimeout(self.autocomplete_timer)
self.autocomplete_timer = self.list.delay(300, self)
},
list: function(){
var self = this;
if(self.api_request) self.api_request.cancel();
self.api_request = self.api().request('movie.add.search', {
'data': {
'q': self.input.get('value')
},
'onComplete': self.fill.bind(self)
})
},
fill: function(){
}
});