summaryrefslogtreecommitdiff
path: root/lib/scripts/behaviour.js
diff options
context:
space:
mode:
authorAdrian Lang <mail@adrianlang.de>2011-07-07 16:08:05 +0200
committerAdrian Lang <mail@adrianlang.de>2011-07-10 12:15:25 +0200
commitd10c9a7424d1ef0aace2fd34e1008196d111a88c (patch)
tree93f439df14ef3b0712f0eb9b3d83e82b6a18d121 /lib/scripts/behaviour.js
parent881f2ee268e95e0cdd02bf593d89ca9b42d03060 (diff)
downloadrpg-d10c9a7424d1ef0aace2fd34e1008196d111a88c.tar.gz
rpg-d10c9a7424d1ef0aace2fd34e1008196d111a88c.tar.bz2
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
Diffstat (limited to 'lib/scripts/behaviour.js')
-rw-r--r--lib/scripts/behaviour.js18
1 files changed, 18 insertions, 0 deletions
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);