Reasons:
* It provides the same functionality as jquery.throttle-debounce, but
in a hackier and less flexible way
* It's (to my knowledge) not used outside of core, while
jquery.throttle-debounce is - deciding on one can lower the payload
size a little bit
* It's a custom library and we have too many of those
Only two modules in core were using it:
* jquery.expandableField: It was, in fact, used incorrectly, the code
needs a simple setTimeout / clearTimeout pair with no debouncing.
The bug made it possible to keep focus on a field while it was
unexpanded (by quickly triggering blur and focus events in order).
* skins.vector.js: Straightforwardly converted the usage to a
$.debounce call. Also fixed a bug where the window resize handler
was bound for each $.fn.collapsibleTabs call instead of once.
The module will be removed in MediaWiki 1.24:
Ifc84b09a78007a6a0ea5676b0f12a38937dca2e7.
Change-Id: I83ba37a9568a171d9f3654f6bfdb6064e0e65bd4
was removed.
* A user_password_expires column has been added to the user table. The User
object expects this column to exist. Use update.php to create this new field.
was removed.
* A user_password_expires column has been added to the user table. The User
object expects this column to exist. Use update.php to create this new field.
+* The jquery.delayedBind ResourceLoader module was deprecated in favor of the
+ jquery.throttle-debounce module. It will be removed in MediaWiki 1.24.
==== Removed classes ====
* FakeMemCachedClient (deprecated in 1.18)
==== Removed classes ====
* FakeMemCachedClient (deprecated in 1.18)
'vector/vector.js',
),
'position' => 'top',
'vector/vector.js',
),
'position' => 'top',
- 'dependencies' => 'jquery.delayedBind',
+ 'dependencies' => 'jquery.throttle-debounce',
'remoteBasePath' => $GLOBALS['wgStylePath'],
'localBasePath' => $GLOBALS['wgStyleDirectory'],
),
'remoteBasePath' => $GLOBALS['wgStylePath'],
'localBasePath' => $GLOBALS['wgStyleDirectory'],
),
),
'jquery.expandableField' => array(
'scripts' => 'resources/jquery/jquery.expandableField.js',
),
'jquery.expandableField' => array(
'scripts' => 'resources/jquery/jquery.expandableField.js',
- 'dependencies' => 'jquery.delayedBind',
),
'jquery.farbtastic' => array(
'scripts' => 'resources/jquery/jquery.farbtastic.js',
),
'jquery.farbtastic' => array(
'scripts' => 'resources/jquery/jquery.farbtastic.js',
/**
* Function that escapes spaces in event names. This is needed because
* "_delayedBind-foo bar-1000" refers to two events
/**
* Function that escapes spaces in event names. This is needed because
* "_delayedBind-foo bar-1000" refers to two events
+mw.log.deprecate( $.fn, 'delayedBind', $.fn.delayedBind,
+ 'Use the jquery.throttle-debounce module instead' );
+mw.log.deprecate( $.fn, 'delayedBindCancel', $.fn.delayedBindCancel,
+ 'Use the jquery.throttle-debounce module instead' );
+mw.log.deprecate( $.fn, 'delayedBindUnbind', $.fn.delayedBindUnbind,
+ 'Use the jquery.throttle-debounce module instead' );
+
+}( mediaWiki, jQuery ) );
args = arguments;
$( this ).each( function () {
args = arguments;
$( this ).each( function () {
+ var key, context, timeout;
/* Construction / Loading */
/* Construction / Loading */
$( this )
.addClass( 'expandableField' )
.focus( function ( e ) {
$( this )
.addClass( 'expandableField' )
.focus( function ( e ) {
+ clearTimeout( timeout );
$.expandableField.expandField( e, context );
} )
$.expandableField.expandField( e, context );
} )
- .delayedBind( 250, 'blur', function ( e ) {
- $.expandableField.condenseField( e, context );
+ .blur( function ( e ) {
+ timeout = setTimeout( function () {
+ $.expandableField.condenseField( e, context );
+ }, 250 );
} );
}
// Store the context for next time
} );
}
// Store the context for next time
- // if we haven't already bound our resize hanlder, bind it now
+ // if we haven't already bound our resize handler, bind it now
if ( !$.collapsibleTabs.boundEvent ) {
if ( !$.collapsibleTabs.boundEvent ) {
- $( window )
- .delayedBind( 500, 'resize', function () {
- $.collapsibleTabs.handleResize();
- } );
+ $( window ).on( 'resize', $.debounce( 500, function () {
+ $.collapsibleTabs.handleResize();
+ } ) );
+ $.collapsibleTabs.boundEvent = true;
// call our resize handler to setup the page
$.collapsibleTabs.handleResize();
return this;
// call our resize handler to setup the page
$.collapsibleTabs.handleResize();
return this;
- /**
- * @param {jQuery.Event} e
- */
handleResize: function () {
$.collapsibleTabs.instances.each( function () {
var $el = $( this ),
handleResize: function () {
$.collapsibleTabs.instances.each( function () {
var $el = $( this ),