mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-11-28 01:00:08 +00:00
Fix certain history events being triggered multiple times
See T349208 for an explanation. It looks like the SliderView.render function was written with the assumption that it's only triggered once on construction time. But since T139101 it's triggered again for every window resize event. This adds the same event handlers over and over again to existing elements that aren't affected by the SliderView.render function. This will probably become even worse with I49878fd (T336729). Please test this carefully. I'm not 100% sure this is the best possible fix. Bug: T349208 Change-Id: Iba22924b660f2709c0680aa6fbeb0feba92cfa76
This commit is contained in:
parent
4ca686ad57
commit
990a9cc828
|
@ -17,6 +17,8 @@ const DiffPage = require( './ext.RevisionSlider.DiffPage.js' ),
|
|||
function SliderView( slider ) {
|
||||
this.slider = slider;
|
||||
this.diffPage = new DiffPage( this.slider.getRevisionList() );
|
||||
this.diffPage.addHandlersToCoreLinks( this );
|
||||
this.diffPage.initOnPopState( this );
|
||||
}
|
||||
|
||||
$.extend( SliderView.prototype, {
|
||||
|
@ -110,9 +112,7 @@ $.extend( SliderView.prototype, {
|
|||
$container.empty().append( this.$element );
|
||||
|
||||
this.slideView( Math.floor( ( this.getNewerPointerPos() - 1 ) / this.slider.getRevisionsPerWindow() ), 0 );
|
||||
this.diffPage.addHandlersToCoreLinks( this );
|
||||
this.diffPage.replaceState( mw.config.get( 'wgDiffNewId' ), mw.config.get( 'wgDiffOldId' ), this );
|
||||
this.diffPage.initOnPopState( this );
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue