user-selector MDL-25975 Fixed timeout bug in user selector that was affecting IE8
authorAdam Olley <adam.olley@netspot.com.au>
Fri, 18 Mar 2011 07:02:55 +0000 (15:02 +0800)
committerSam Hemelryk <sam@moodle.com>
Fri, 18 Mar 2011 07:02:55 +0000 (15:02 +0800)
user/selector/module.js

index d53b5e0..e6818c8 100644 (file)
@@ -89,7 +89,7 @@ M.core_user.init_user_selector = function (Y, name, hash, extrafields, lastsearc
         handle_keyup : function(e) {
             //  Trigger an ajax search after a delay.
             this.cancel_timeout();
-            this.timeoutid = setTimeout(function(obj){obj.send_query(false)}, this.querydelay*1000, this);
+            this.timeoutid = Y.later(this.querydelay*1000, e, function(obj){obj.send_query(false)}, this);
 
             // Enable or diable the clear button.
             this.clearbutton.set('disabled', (this.get_search_text() == ''));