diff options
author | John Resig <jeresig@gmail.com> | 2006-06-22 21:37:18 +0000 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2006-06-22 21:37:18 +0000 |
commit | 0fd3648d45be72bcfe76b95715b38dd5904b47da (patch) | |
tree | c8a3adc4149d3ea65472bdbc935bf804a8c3bcc2 | |
parent | 6ae392a4e57834224b2a686d774ab210da25daa5 (diff) | |
download | jquery-0fd3648d45be72bcfe76b95715b38dd5904b47da.tar.gz jquery-0fd3648d45be72bcfe76b95715b38dd5904b47da.zip |
Added in both of Franck's suggested fixes jQuery.class and "foo" + "bar".split(",").
-rw-r--r-- | event/event.js | 4 | ||||
-rw-r--r-- | jquery/jquery.js | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/event/event.js b/event/event.js index 4171562ec..4bef51404 100644 --- a/event/event.js +++ b/event/event.js @@ -67,9 +67,9 @@ jQuery.prototype.ready = function(f) { /* * Bind a number of event-handling functions, dynamically */ - var e = "blur,focus,contextmenu,load,resize,scroll,unload,click,dblclick," + + var e = ("blur,focus,contextmenu,load,resize,scroll,unload,click,dblclick," + "mousedown,mouseup,mouseenter,mouseleave,mousemove,mouseover,mouseout," + - "change,reset,select,submit,keydown,keypress,keyup,abort,error,ready".split(","); + "change,reset,select,submit,keydown,keypress,keyup").split(","); // Go through all the event names, but make sure that // it is enclosed properly diff --git a/jquery/jquery.js b/jquery/jquery.js index f54d05ea1..97fa48ee5 100644 --- a/jquery/jquery.js +++ b/jquery/jquery.js @@ -129,21 +129,21 @@ jQuery.fn = jQuery.prototype = { }, addClass: function(c) { return this.each(function(){ - jQuery.class.add(this,c); + jQuery.className.add(this,c); }); }, removeClass: function(c) { return this.each(function(){ - jQuery.class.remove(this,c); + jQuery.className.remove(this,c); }); }, toggleClass: function(c) { return this.each(function(){ if (jQuery.hasWord(this,c)) - jQuery.class.remove(this,c); + jQuery.className.remove(this,c); else - jQuery.class.add(this,c); + jQuery.className.add(this,c); }); }, remove: function() { @@ -318,10 +318,10 @@ jQuery.fn = jQuery.prototype = { } }; -jQuery.class = { +jQuery.className = { add: function(o,c){ if (jQuery.hasWord(o,c)) return; - o.className += ( o.className.length > 0 ? " " : "" ) + c; + o.className += ( o.className ? " " : "" ) + c; }, remove: function(o,c){ o.className = !c ? "" : |