Show correct slider window after refresh when the last revision is selected.

This fixes a bug that would show a slider window where neither of
the pointers is visible after selecting the last revision of the current
window with the old revision pointer and then refreshing.

Change-Id: I15402d8ca7b8c783990a32e2d8426871763e20e1
This commit is contained in:
Jakob Warkotsch 2016-05-27 16:10:59 +02:00
parent b0466a9615
commit 49dea1cf68

View file

@ -141,7 +141,7 @@
this.$element = $slider;
$container.html( $slider );
this.slide( Math.floor( this.pointerTwo.getPosition() / this.slider.getRevisionsPerWindow() ), 0 );
this.slide( Math.floor( ( this.pointerTwo.getPosition() - 1 ) / this.slider.getRevisionsPerWindow() ), 0 );
this.diffPage.pushState( mw.config.values.extRevisionSliderOldRev, mw.config.values.extRevisionSliderNewRev, this );
this.diffPage.initOnPopState( this );
},