From 63601400e476c6cf43d985f3e7b9864681695ed4 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 18 Jan 2013 16:46:04 +0100 Subject: Update to MediaWiki 1.20.2 this update includes: * adjusted Arch Linux skin * updated FluxBBAuthPlugin * patch for https://bugzilla.wikimedia.org/show_bug.cgi?id=44024 --- resources/jquery/jquery.delayedBind.js | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'resources/jquery/jquery.delayedBind.js') diff --git a/resources/jquery/jquery.delayedBind.js b/resources/jquery/jquery.delayedBind.js index d84ee267..5d32b6b0 100644 --- a/resources/jquery/jquery.delayedBind.js +++ b/resources/jquery/jquery.delayedBind.js @@ -1,4 +1,4 @@ -(function( $ ) { +( function ( $ ) { /** * Function that escapes spaces in event names. This is needed because * "_delayedBind-foo bar-1000" refers to two events @@ -18,25 +18,26 @@ $.fn.extend( { * @param data Data to pass to the event handler (optional) * @param callback Function to call */ - delayedBind: function( timeout, event, data, callback ) { - if ( arguments.length == 3 ) { + delayedBind: function ( timeout, event, data, callback ) { + if ( arguments.length === 3 ) { // Shift optional parameter down callback = data; data = undefined; } var encEvent = encodeEvent( event ); - return this.each( function() { + return this.each( function () { var that = this; // Bind the top half // Do this only once for every (event, timeout) pair if ( !( $(this).data( '_delayedBindBound-' + encEvent + '-' + timeout ) ) ) { $(this).data( '_delayedBindBound-' + encEvent + '-' + timeout, true ); - $(this).bind( event, function() { + $(this).bind( event, function () { var timerID = $(this).data( '_delayedBindTimerID-' + encEvent + '-' + timeout ); // Cancel the running timer - if ( typeof timerID != 'undefined' ) + if ( timerID !== null ) { clearTimeout( timerID ); - timerID = setTimeout( function() { + } + timerID = setTimeout( function () { $(that).trigger( '_delayedBind-' + encEvent + '-' + timeout ); }, timeout ); $(this).data( '_delayedBindTimerID-' + encEvent + '-' + timeout, timerID ); @@ -51,23 +52,25 @@ $.fn.extend( { /** * Cancel the timers for delayed events on the selected elements. */ - delayedBindCancel: function( timeout, event ) { + delayedBindCancel: function ( timeout, event ) { var encEvent = encodeEvent( event ); - return this.each( function() { + return this.each( function () { var timerID = $(this).data( '_delayedBindTimerID-' + encEvent + '-' + timeout ); - if ( typeof timerID != 'undefined' ) + if ( timerID !== null ) { clearTimeout( timerID ); + } } ); }, /** * Unbind an event bound with delayedBind() */ - delayedBindUnbind: function( timeout, event, callback ) { + delayedBindUnbind: function ( timeout, event, callback ) { var encEvent = encodeEvent( event ); - return this.each( function() { + return this.each( function () { $(this).unbind( '_delayedBind-' + encEvent + '-' + timeout, callback ); } ); } } ); -} )( jQuery ); \ No newline at end of file + +}( jQuery ) ); -- cgit v1.2.2