From d10c9a7424d1ef0aace2fd34e1008196d111a88c Mon Sep 17 00:00:00 2001 From: Adrian Lang Date: Thu, 7 Jul 2011 16:08:05 +0200 Subject: Rewrite mediamanager JavaScript Make it faster, prettier, less wrong, add UI effects, use jQuery UI Dialog, Abstract tree view stuff away into jQuery.dw_tree --- lib/scripts/behaviour.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lib/scripts/behaviour.js') diff --git a/lib/scripts/behaviour.js b/lib/scripts/behaviour.js index db9dbacc2..dd7676432 100644 --- a/lib/scripts/behaviour.js +++ b/lib/scripts/behaviour.js @@ -124,4 +124,22 @@ var dw_behaviour = { }; +jQuery.fn.dw_hide = function(fn) { + return this.slideUp('fast', fn); +}; + +jQuery.fn.dw_show = function() { + return this.slideDown('fast'); +}; + +jQuery.fn.dw_toggle = function(bool) { + return this.each(function() { + var $this = jQuery(this); + if (typeof bool === 'undefined') { + bool = $this.is(':hidden'); + } + $this[bool ? "dw_show" : "dw_hide" ](); + }); +}; + jQuery(dw_behaviour.init); -- cgit v1.2.3