diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-12-28 19:57:11 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-12-28 19:57:11 +0100 |
commit | 2ea0d4a87489efd57a30f8a04b660fe1fc7701da (patch) | |
tree | 763a10d705b39a7e59ee97af8800b662fe07b010 /module/web/static/js/utils/animations.js | |
parent | button for progress popover (diff) | |
download | pyload-2ea0d4a87489efd57a30f8a04b660fe1fc7701da.tar.xz |
added animate-enhanced
Diffstat (limited to 'module/web/static/js/utils/animations.js')
-rw-r--r-- | module/web/static/js/utils/animations.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/module/web/static/js/utils/animations.js b/module/web/static/js/utils/animations.js index 18360c526..2840bba66 100644 --- a/module/web/static/js/utils/animations.js +++ b/module/web/static/js/utils/animations.js @@ -62,13 +62,14 @@ define(['jquery', 'underscore', 'transit'], function(jQuery, _) { jQuery.fn._transit = jQuery.fn.transit; // Overriding transit plugin to support hide and show - // Props retains it properties across multiple calls, therefore props.show value is introduced jQuery.fn.transit = jQuery.fn.transition = function(props, duration, easing, callback) { var self = this; var cb = callback; - if (props && (props.opacity === 'hide' || (props.opacity === 0 && props.show === true))) { - props.opacity = 0; - props.show = true; + var newprops = _.extend({}, props); + console.log(newprops); + + if (newprops && (newprops.opacity === 'hide')) { + newprops.opacity = 0; callback = function() { self.css({display: 'none'}); @@ -76,12 +77,11 @@ define(['jquery', 'underscore', 'transit'], function(jQuery, _) { cb.apply(self); } }; - } else if (props && (props.opacity === 'show' || (props.opacity === 1 && props.show === true))) { - props.opacity = 1; - props.show = true; + } else if (newprops && (newprops.opacity === 'show')) { + newprops.opacity = 1; this.css({display: 'block'}); } - return this._transit(props, duration, easing, callback); + return this._transit(newprops, duration, easing, callback); }; });
\ No newline at end of file |