From 87e709cfcbac345520d937963730b5cfee47d33d Mon Sep 17 00:00:00 2001 From: Mike Sherov Date: Mon, 11 Jun 2012 21:01:23 -0400 Subject: [PATCH] Fix regression for "-200px" in animations; closes gh-822. Also removes fake IIFEs ffrom effects. --- src/effects.js | 6 +----- test/unit/effects.js | 9 +++++++++ 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(); -- 2.39.5