Fix for typo in toggleClass docs
[jquery.git] / src / jquery / jquery.js
index 430e24f..53ffc16 100644 (file)
@@ -1472,7 +1472,7 @@ jQuery.extend({
                if ( p == "height" || p == "width" ) {
                        var old = {}, oHeight, oWidth, d = ["Top","Bottom","Right","Left"];
 
-                       for ( var i in d ) {
+                       for ( var i=0; i<d.length; i++ ) {
                                old["padding" + d[i]] = 0;
                                old["border" + d[i] + "Width"] = 0;
                        }
@@ -2245,8 +2245,8 @@ jQuery.extend({
                },
 
                trigger: function(type,data,element) {
-                       // Touch up the incoming data
-                       data = data || [];
+                       // Clone the incoming data, if any
+                       data = $.merge([], data || []);
 
                        // Handle a global trigger
                        if ( !element ) {
@@ -3318,8 +3318,8 @@ jQuery.macros = {
                },
 
                /**
-                * Adds the specified class if it is present, removes it if it is
-                * not present.
+                * Adds the specified class if it is not present, removes it if it is
+                * present.
                 *
                 * @example $("p").toggleClass("selected")
                 * @before <p>Hello</p><p class="selected">Hello Again</p>