From 9fd5ca2ec2955ee29404be1a39ddd9affcd0c78f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Gro=CC=88nke?= Date: Sat, 19 Jan 2013 16:30:42 +0100 Subject: 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) --- lib/scripts/behaviour.js | 74 ++++++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'lib/scripts/behaviour.js') 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,3 +1,38 @@ +/** + * Hides elements with a slide animation + * + * @param fn optional callback to run after hiding + * @author Adrian Lang + */ +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 + */ +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 * @@ -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 - */ -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 - */ -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); -- cgit v1.2.3