mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-12-04 11:48:26 +00:00
Merge "Dont push state to history in cases where not possible"
This commit is contained in:
commit
19c50267e7
|
@ -41,17 +41,20 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
pushState: function ( revId1, revId2, sliderView ) {
|
pushState: function ( revId1, revId2, sliderView ) {
|
||||||
history.pushState(
|
// IE8 and IE9 do not have history.pushState()
|
||||||
{
|
if ( typeof history.pushState === 'function' ) {
|
||||||
revid1: revId1,
|
history.pushState(
|
||||||
revid2: revId2,
|
{
|
||||||
leftPos: sliderView.pointerOne.getPosition(),
|
revid1: revId1,
|
||||||
rightPos: sliderView.pointerTwo.getPosition(),
|
revid2: revId2,
|
||||||
sliderPos: sliderView.slider.getFirstVisibleRevisionIndex()
|
leftPos: sliderView.pointerOne.getPosition(),
|
||||||
},
|
rightPos: sliderView.pointerTwo.getPosition(),
|
||||||
$( document ).find( 'title' ).text(),
|
sliderPos: sliderView.slider.getFirstVisibleRevisionIndex()
|
||||||
mw.util.wikiScript( 'index' ) + '?diff=' + Math.max( revId1, revId2 ) + '&oldid=' + Math.min( revId1, revId2 )
|
},
|
||||||
);
|
$( document ).find( 'title' ).text(),
|
||||||
|
mw.util.wikiScript( 'index' ) + '?diff=' + Math.max( revId1, revId2 ) + '&oldid=' + Math.min( revId1, revId2 )
|
||||||
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
initOnPopState: function ( sliderView ) {
|
initOnPopState: function ( sliderView ) {
|
||||||
|
|
Loading…
Reference in a new issue