aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Sherov <mike.sherov@gmail.com>2012-06-11 21:01:23 -0400
committerDave Methvin <dave.methvin@gmail.com>2012-06-11 21:01:23 -0400
commit87e709cfcbac345520d937963730b5cfee47d33d (patch)
tree562d8f4d02af283e1d41dbdf14c0e78852b6c81e
parentf8c02c886efdf3e42819a960da28738e20bb7a48 (diff)
downloadjquery-87e709cfcbac345520d937963730b5cfee47d33d.tar.gz
jquery-87e709cfcbac345520d937963730b5cfee47d33d.zip
Fix regression for "-200px" in animations; closes gh-822.
Also removes fake IIFEs ffrom effects.
-rw-r--r--src/effects.js6
-rw-r--r--test/unit/effects.js9
2 files changed, 10 insertions, 5 deletions
diff --git a/src/effects.js b/src/effects.js
index 7aae8a414..f5c1f8d47 100644
--- a/src/effects.js
+++ b/src/effects.js
@@ -1,8 +1,6 @@
-(function( jQuery ) {
-
var fxNow, timerId,
rfxtypes = /^(?:toggle|show|hide)$/,
- rfxnum = /^([\-+]=)?((?:\d*\.)?\d+)([a-z%]*)$/i,
+ rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
rrun = /queueHooks$/,
animationPrefilters = [ defaultPrefilter ],
tweeners = {
@@ -633,5 +631,3 @@ if ( jQuery.expr && jQuery.expr.filters ) {
}).length;
};
}
-
-})( jQuery );
diff --git a/test/unit/effects.js b/test/unit/effects.js
index 48793e234..729ba29bc 100644
--- a/test/unit/effects.js
+++ b/test/unit/effects.js
@@ -197,6 +197,15 @@ test("animate negative margin", function() {
});
});
+test("animate negative margin with px", function() {
+ expect(1);
+ stop();
+ jQuery("#foo").animate({ marginTop: "-100px" }, 100, function() {
+ equal( jQuery(this).css("marginTop"), "-100px", "Verify margin." );
+ start();
+ });
+});
+
test("animate negative padding", function() {
expect(1);
stop();