diff options
author | Mike Sherov <mike.sherov@gmail.com> | 2012-12-26 08:35:42 -0500 |
---|---|---|
committer | Mike Sherov <mike.sherov@gmail.com> | 2014-12-10 16:58:38 -0500 |
commit | b6bec797d6a8ef0b377a866c38c67e66a626b45f (patch) | |
tree | 2e38a21f1a3894ebe6c44283fd568243611cc403 /ui/effect-highlight.js | |
parent | 2a99bb7d37b7084b22b106040441a94f43785a05 (diff) | |
download | jquery-ui-b6bec797d6a8ef0b377a866c38c67e66a626b45f.tar.gz jquery-ui-b6bec797d6a8ef0b377a866c38c67e66a626b45f.zip |
Effects: Rewrite
1. Introduces a set of helper methods to easily create and define new effects.
2. Uses clip animations and placeholders instead of wrappers for clip effects.
3. Ensures all animations are detectable as animated
Fixes #10599
Fixes #9477
Fixes #9257
Fixes #9066
Fixes #8867
Fixes #8671
Fixes #8505
Fixes #7885
Fixes #7041
Closes gh-1017
Diffstat (limited to 'ui/effect-highlight.js')
-rw-r--r-- | ui/effect-highlight.js | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/ui/effect-highlight.js b/ui/effect-highlight.js index e3ad3cbc4..fb44aef91 100644 --- a/ui/effect-highlight.js +++ b/ui/effect-highlight.js @@ -28,38 +28,29 @@ } }(function( $ ) { -return $.effects.effect.highlight = function( o, done ) { - var elem = $( this ), - props = [ "backgroundImage", "backgroundColor", "opacity" ], - mode = $.effects.setMode( elem, o.mode || "show" ), +return $.effects.define( "highlight", "show", function( options, done ) { + var element = $( this ), animation = { - backgroundColor: elem.css( "backgroundColor" ) + backgroundColor: element.css( "backgroundColor" ) }; - if (mode === "hide") { + if ( options.mode === "hide" ) { animation.opacity = 0; } - $.effects.save( elem, props ); + $.effects.saveStyle( element ); - elem - .show() + element .css({ backgroundImage: "none", - backgroundColor: o.color || "#ffff99" + backgroundColor: options.color || "#ffff99" }) .animate( animation, { queue: false, - duration: o.duration, - easing: o.easing, - complete: function() { - if ( mode === "hide" ) { - elem.hide(); - } - $.effects.restore( elem, props ); - done(); - } + duration: options.duration, + easing: options.easing, + complete: done }); -}; +}); })); |