summaryrefslogtreecommitdiffstats
path: root/module/web/static/js/utils
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-01-26 23:33:55 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-01-26 23:33:55 +0100
commit0541a50bae77fca45c9b6d633b39595b4d933103 (patch)
tree61ec45609ef6168b7c69fc39a66916acc9fa466b /module/web/static/js/utils
parentfix ssl deactivation for server selector (diff)
downloadpyload-0541a50bae77fca45c9b6d633b39595b4d933103.tar.xz
little fixes, added pyload logo as svg
Diffstat (limited to 'module/web/static/js/utils')
-rw-r--r--module/web/static/js/utils/animations.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/module/web/static/js/utils/animations.js b/module/web/static/js/utils/animations.js
index aa48c6f00..657bd2bec 100644
--- a/module/web/static/js/utils/animations.js
+++ b/module/web/static/js/utils/animations.js
@@ -1,7 +1,31 @@
define(['jquery', 'underscore', 'transit'], function(jQuery, _) {
+ // Adds an element and computes its height, which is saved as data attribute
+ // Important function to have slide animations
+ jQuery.fn.appendWithHeight = function(element, hide) {
+ var o = jQuery(this[0]);
+
+ // TODO: additionally it could be placed out of viewport first
+ // The real height can only be retrieved when element is on DOM and display:true
+ element.css('visibility', 'hidden');
+ o.append(element);
+
+ var height = element.height();
+
+ // Hide the element
+ if (hide === true) {
+ element.hide();
+ element.height(0);
+ }
+
+ element.css('visibility', '');
+ element.data('height', height);
+
+ return this;
+ };
// TODO: sloppy chaining
+ //
// in functions not possible without previous out
jQuery.fn.zapIn = function(speed, easing, callback) {