diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-02-20 12:00:22 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-02-20 12:00:22 +0100 |
commit | 1e1b64539144006c59c7b705700fc7f34c7a26b1 (patch) | |
tree | ebae99f037953469d4437331763c0c38d41e9511 /module/web/static/js/utils | |
parent | integrated new package view (diff) | |
download | pyload-1e1b64539144006c59c7b705700fc7f34c7a26b1.tar.xz |
more animation for dashboard
Diffstat (limited to 'module/web/static/js/utils')
-rw-r--r-- | module/web/static/js/utils/animations.js | 36 |
1 files changed, 6 insertions, 30 deletions
diff --git a/module/web/static/js/utils/animations.js b/module/web/static/js/utils/animations.js index 245614ea7..798f69358 100644 --- a/module/web/static/js/utils/animations.js +++ b/module/web/static/js/utils/animations.js @@ -28,13 +28,17 @@ define(['jquery', 'underscore', 'transit'], function(jQuery, _) { // Shortcut to have a animation when element is added jQuery.fn.appendWithAnimation = function(element, animation) { var o = jQuery(this[0]); + element = jQuery(element); + if (animation === true) - o.hide(); + element.hide(); o.append(element); if (animation === true) - o.fadeIn(); + element.fadeIn(); + + element.calculateHeight(); return this; }; @@ -69,34 +73,6 @@ define(['jquery', 'underscore', 'transit'], function(jQuery, _) { return this; }; - // TODO: sloppy chaining - // - // in functions not possible without previous out - - jQuery.fn.zapIn = function(speed, easing, callback) { - var height = this.data('height') || '100%'; - this.transition({ - height: height, - scale: [1, 1], - opacity: 'show' - }, speed, easing, callback); - - }; - - jQuery.fn.zapOut = function(speed, easing, callback) { - if (!this.data('height')) { - var height = this.height(); - this.css({height: height}); - this.data('height', height); - } - this.transition({ - height: '0px', - scale: [1, 0], - opacity: 'hide' - }, speed, easing, callback); - - }; - jQuery.fn._transit = jQuery.fn.transit; // Overriding transit plugin to support hide and show |