Esanders has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/315617

Change subject: Throttle the window resize event handler
......................................................................

Throttle the window resize event handler

Drag-resizing a window results in hundreds of events being fired,
so limit this to one event every 250ms.

Change-Id: Ie3ace9001cd840a5d790cd269c4ae3c77649079a
---
M modules/ext.RevisionSlider.init.js
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/RevisionSlider 
refs/changes/17/315617/1

diff --git a/modules/ext.RevisionSlider.init.js 
b/modules/ext.RevisionSlider.init.js
index fbdb217..982f874 100644
--- a/modules/ext.RevisionSlider.init.js
+++ b/modules/ext.RevisionSlider.init.js
@@ -38,9 +38,9 @@
                                        slider = new 
mw.libs.revisionSlider.Slider( revisionList );
                                        slider.getView().render( $container );
 
-                                       window.addEventListener( 'resize', 
function () {
+                                       $( window ).on( 'resize', 
OO.ui.throttle( function () {
                                                slider.getView().render( 
$container );
-                                       } );
+                                       }, 250 ) );
 
                                        if ( !mw.user.options.get( 
'userjs-revslider-hidehelp' ) ) {
                                                
mw.libs.revisionSlider.HelpDialog.show();

-- 
To view, visit https://gerrit.wikimedia.org/r/315617
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie3ace9001cd840a5d790cd269c4ae3c77649079a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/RevisionSlider
Gerrit-Branch: master
Gerrit-Owner: Esanders <esand...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to