diff options
author | Andreas Gohr <andi@splitbrain.org> | 2013-01-26 11:35:33 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2013-01-26 11:35:33 +0100 |
commit | 2ee10302a5a0aa250099733ca1208d94e86cb406 (patch) | |
tree | 99101801967d5473fc9d3e66f0e7da44ab2c5501 /lib/scripts/behaviour.js | |
parent | ba56222349781fd8e3938ab18127d46f3c1e0061 (diff) | |
parent | 930913b3152f64b46cbc08adc1f899bf37bb3d3a (diff) | |
download | dokuwiki-2ee10302a5a0aa250099733ca1208d94e86cb406.tar.gz dokuwiki-2ee10302a5a0aa250099733ca1208d94e86cb406.zip |
Merge branch 'master' of git://github.com/gronke/dokuwiki into pull-request-158
* 'master' of git://github.com/gronke/dokuwiki:
update.js applied
update.sh must overwrite stylesheet
jQuery update.sh
jQuery latest
Diffstat (limited to 'lib/scripts/behaviour.js')
-rw-r--r-- | lib/scripts/behaviour.js | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/lib/scripts/behaviour.js b/lib/scripts/behaviour.js index cffdde042..6878b0b96 100644 --- a/lib/scripts/behaviour.js +++ b/lib/scripts/behaviour.js @@ -1,4 +1,39 @@ /** + * Hides elements with a slide animation + * + * @param fn optional callback to run after hiding + * @author Adrian Lang <mail@adrianlang.de> + */ +jQuery.fn.dw_hide = function(fn) { + return this.slideUp('fast', fn); +}; + +/** + * Unhides elements with a slide animation + * + * @param fn optional callback to run after hiding + * @author Adrian Lang <mail@adrianlang.de> + */ +jQuery.fn.dw_show = function(fn) { + return this.slideDown('fast', fn); +}; + +/** + * Toggles visibility of an element using a slide element + * + * @param bool the current state of the element (optional) + */ +jQuery.fn.dw_toggle = function(bool, fn) { + return this.each(function() { + var $this = jQuery(this); + if (typeof bool === 'undefined') { + bool = $this.is(':hidden'); + } + $this[bool ? "dw_show" : "dw_hide" ](fn); + }); +}; + +/** * Automatic behaviours * * This class wraps various JavaScript functionalities that are triggered @@ -16,7 +51,7 @@ var dw_behaviour = { dw_behaviour.subscription(); dw_behaviour.revisionBoxHandler(); - jQuery('#page__revisions input[type=checkbox]').live('click', + jQuery('#page__revisions input[type=checkbox]').on('click', dw_behaviour.revisionBoxHandler ); }, @@ -77,7 +112,7 @@ var dw_behaviour = { return; } - jQuery('a.windows').live('click', function(){ + jQuery('a.windows').on('click', function(){ alert(LANG.nosmblinks.replace(/\\n/,"\n")); }); }, @@ -142,39 +177,4 @@ var dw_behaviour = { }; -/** - * Hides elements with a slide animation - * - * @param fn optional callback to run after hiding - * @author Adrian Lang <mail@adrianlang.de> - */ -jQuery.fn.dw_hide = function(fn) { - return this.slideUp('fast', fn); -}; - -/** - * Unhides elements with a slide animation - * - * @param fn optional callback to run after hiding - * @author Adrian Lang <mail@adrianlang.de> - */ -jQuery.fn.dw_show = function(fn) { - return this.slideDown('fast', fn); -}; - -/** - * Toggles visibility of an element using a slide element - * - * @param bool the current state of the element (optional) - */ -jQuery.fn.dw_toggle = function(bool, fn) { - return this.each(function() { - var $this = jQuery(this); - if (typeof bool === 'undefined') { - bool = $this.is(':hidden'); - } - $this[bool ? "dw_show" : "dw_hide" ](fn); - }); -}; - jQuery(dw_behaviour.init); |