diff options
author | Stefan Grönke <stefan@gronke.net> | 2013-01-19 16:30:42 +0100 |
---|---|---|
committer | Stefan Grönke <stefan@gronke.net> | 2013-01-19 16:30:42 +0100 |
commit | 9fd5ca2ec2955ee29404be1a39ddd9affcd0c78f (patch) | |
tree | d15cd6573521bcb416116d8872fbef95eb7789c9 /lib/scripts/behaviour.js | |
parent | e6c4a8221e93692572a1e78b9319a94b5ba07a0c (diff) | |
download | dokuwiki-9fd5ca2ec2955ee29404be1a39ddd9affcd0c78f.tar.gz dokuwiki-9fd5ca2ec2955ee29404be1a39ddd9affcd0c78f.zip |
jQuery latest
* jQuery 1.9.0
* jQuery-UI v1.9.2
* jQuery.fn.live > jQuery.fn.on
* jQuery.fn.browser replacement (jquery.mb.browser.js)
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); |