mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 06:46:26 +00:00
Followup 3dd1a996
: don't try to switch to source mode when surface is torn down
If you saved a change, then clicked Edit source, you'd get a JS error. Change-Id: I589f9edb354afcd47d5c42ef9a6c73d49218b044
This commit is contained in:
parent
de2d5bd31b
commit
35e611369b
|
@ -1112,10 +1112,12 @@ ve.init.mw.ViewPageTarget.prototype.setupSkinTabs = function () {
|
|||
.click( this.onViewTabClick.bind( this ) );
|
||||
|
||||
$( '#ca-viewsource, #ca-edit' ).click( function ( e ) {
|
||||
viewPageTarget.editSource();
|
||||
if ( viewPageTarget.surface && !viewPageTarget.deactivating ) {
|
||||
viewPageTarget.editSource();
|
||||
|
||||
if ( viewPageTarget.surface.getModel().hasBeenModified() ) {
|
||||
e.preventDefault();
|
||||
if ( viewPageTarget.surface.getModel().hasBeenModified() ) {
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue