mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
Only set diffmode-historical user option when it has changed
Bug: T290703 Change-Id: I289e0c20db9235a432f7f49a425328ab617d57f3
This commit is contained in:
parent
717b5cf534
commit
b57fe3e8ba
|
@ -45,9 +45,11 @@
|
|||
mode = item.getData();
|
||||
var isVisual = mode === 'visual';
|
||||
|
||||
mw.user.options.set( 'visualeditor-diffmode-historical', mode );
|
||||
// Same as ve.init.target.getLocalApi()
|
||||
new mw.Api().saveOption( 'visualeditor-diffmode-historical', mode );
|
||||
if ( mode !== mw.user.options.get( 'visualeditor-diffmode-historical' ) ) {
|
||||
mw.user.options.set( 'visualeditor-diffmode-historical', mode );
|
||||
// Same as ve.init.target.getLocalApi()
|
||||
new mw.Api().saveOption( 'visualeditor-diffmode-historical', mode );
|
||||
}
|
||||
$visualDiffContainer.toggleClass( 'oo-ui-element-hidden', !isVisual );
|
||||
$wikitextDiffBody.toggleClass( 'oo-ui-element-hidden', isVisual );
|
||||
$revSlider.toggleClass( 've-init-mw-diffPage-revSlider-visual', isVisual );
|
||||
|
|
Loading…
Reference in a new issue