mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 19:26:46 +00:00
If user is anonymous, mw.page.watch is not loaded. Only call
method if module is loaded. Change-Id: Ieb549b701f05f1dab322baa79d59366225f42727
This commit is contained in:
parent
5968991d25
commit
4b8833942c
|
@ -191,14 +191,17 @@ ve.init.ViewPageTarget.prototype.onSave = function( html ) {
|
|||
// This is a page creation, refresh the page
|
||||
window.location.href = this.viewUri;
|
||||
} else {
|
||||
// Update the watch link to match the state of 'watch checkbox' in save dialog
|
||||
var watchPage = this.$saveDialog
|
||||
.find( '#ve-init-viewPageTarget-saveDialog-watchList')
|
||||
.prop( 'checked' );
|
||||
mw.page.watch.updateWatchLink(
|
||||
$('#ca-watch a, #ca-unwatch a'),
|
||||
watchPage === true ? 'unwatch': 'watch'
|
||||
);
|
||||
// Update watch link to match 'watch checkbox' in save dialog.
|
||||
// User logged in if module loaded.
|
||||
if ( mw.page.watch !== undefined ) {
|
||||
var watchPage = this.$saveDialog
|
||||
.find( '#ve-init-viewPageTarget-saveDialog-watchList')
|
||||
.prop( 'checked' );
|
||||
mw.page.watch.updateWatchLink(
|
||||
$('#ca-watch a, #ca-unwatch a'),
|
||||
watchPage === true ? 'unwatch': 'watch'
|
||||
);
|
||||
}
|
||||
this.hideSaveDialog();
|
||||
this.resetSaveDialog();
|
||||
this.replacePageContent( html );
|
||||
|
|
Loading…
Reference in a new issue