mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-27 17:40:06 +00:00
Replace deprecated jQuery.throttle/debounce
This requires MediaWiki 1.38 for mw.util.throttle. Bug: T213426 Change-Id: I3f689eea837ef72de9ab7afb68578093eab8db20
This commit is contained in:
parent
9f65108e8d
commit
a10359e6e6
|
@ -28,7 +28,7 @@
|
|||
"license-name": "GPL-2.0-or-later",
|
||||
"type": "other",
|
||||
"requires": {
|
||||
"MediaWiki": ">= 1.35.0"
|
||||
"MediaWiki": ">= 1.38.0"
|
||||
},
|
||||
"MessagesDirs": {
|
||||
"MultimediaViewer": [
|
||||
|
@ -106,7 +106,6 @@
|
|||
"oojs",
|
||||
"oojs-router",
|
||||
"jquery.fullscreen",
|
||||
"jquery.throttle-debounce",
|
||||
"jquery.color",
|
||||
"jquery.tipsy",
|
||||
"mmv.bootstrap",
|
||||
|
|
|
@ -189,9 +189,9 @@
|
|||
this.handleEvent( 'keydown', function ( e ) { ui.keydown( e ); } );
|
||||
|
||||
// mousemove generates a ton of events, which is why we throttle it
|
||||
this.handleEvent( 'mousemove.lip', $.throttle( 250, function ( e ) {
|
||||
this.handleEvent( 'mousemove.lip', mw.util.throttle( function ( e ) {
|
||||
ui.mousemove( e );
|
||||
} ) );
|
||||
}, 250 ) );
|
||||
|
||||
this.handleEvent( 'mmv-faded-out', function ( e ) { ui.fadedOut( e ); } );
|
||||
this.handleEvent( 'mmv-fade-stopped', function ( e ) { ui.fadeStopped( e ); } );
|
||||
|
|
|
@ -231,9 +231,9 @@
|
|||
C.attach = function () {
|
||||
var canvas = this;
|
||||
|
||||
$( window ).on( 'resize.mmv-canvas', $.debounce( 100, function () {
|
||||
$( window ).on( 'resize.mmv-canvas', mw.util.debounce( function () {
|
||||
canvas.$mainWrapper.trigger( $.Event( 'mmv-resize-end' ) );
|
||||
} ) );
|
||||
}, 100 ) );
|
||||
|
||||
this.$imageWrapper.on( 'click.mmv-canvas', function () {
|
||||
if ( canvas.$container.closest( '.metadata-panel-is-open' ).length > 0 ) {
|
||||
|
|
|
@ -67,9 +67,9 @@
|
|||
panel.keydown( e );
|
||||
} );
|
||||
|
||||
$( window ).on( 'scroll.mmvp', $.throttle( 250, function () {
|
||||
$( window ).on( 'scroll.mmvp', mw.util.throttle( function () {
|
||||
panel.scroll();
|
||||
} ) );
|
||||
}, 250 ) );
|
||||
|
||||
this.$container.on( 'mmv-metadata-open', function () {
|
||||
if ( !panel.hasOpenedMetadata && panel.localStorage.store ) {
|
||||
|
|
|
@ -106,7 +106,7 @@
|
|||
};
|
||||
|
||||
TTFP.attach = function () {
|
||||
$( window ).on( 'resize.mmv-ttf', $.debounce( 100, this.repaint.bind( this ) ) );
|
||||
$( window ).on( 'resize.mmv-ttf', mw.util.debounce( this.repaint.bind( this ), 100 ) );
|
||||
};
|
||||
|
||||
TTFP.unattach = function () {
|
||||
|
|
Loading…
Reference in a new issue