Skip to content

Commit

Permalink
VisualDiff: Store diffmode in query string on diff pages
Browse files Browse the repository at this point in the history
Change-Id: I092ac68dd31b29b4418e7afb37bfe94befa16558
  • Loading branch information
edg2s committed Aug 10, 2017
1 parent 57dfd91 commit 1d70266
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modules/ve-mw/init/ve.init.mw.DiffPage.init.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
reviewModeButtonSelect,
revCache = {},
uri = new mw.Uri(),
mode = 'source',
mode = uri.query.diffmode || 'source',
conf = mw.config.get( 'wgVisualEditorConfig' ),
pluginModules = conf.pluginModules.filter( mw.loader.getState );

Expand Down Expand Up @@ -83,6 +83,12 @@
$wikitextDiff.removeClass( 'oo-ui-element-hidden' );
$revSlider.removeClass( 've-init-mw-diffPage-revSlider-visual' );
}

if ( history.replaceState ) {
uri.query.diffmode = mode;
history.replaceState( '', document.title, uri );
}

}

mw.hook( 'wikipage.diff' ).add( function () {
Expand Down

0 comments on commit 1d70266

Please sign in to comment.