mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 16:20:52 +00:00
Run VE->WTE modification checks regardless of how the user got into VE
I think this fixes a bug similar to the one described in the bug below. Bug: T124708 Change-Id: I61558227315bec36b71dac281b8da311a3d6bb1a
This commit is contained in:
parent
de5f372ac5
commit
8cc034b9af
|
@ -878,20 +878,20 @@ ve.init.mw.DesktopArticleTarget.prototype.setupSkinTabs = function () {
|
|||
$( '#ca-view a, #ca-nstab-visualeditor a' )
|
||||
.on( 'click', this.onViewTabClick.bind( this ) );
|
||||
|
||||
$( '#ca-viewsource, #ca-edit' ).on( 'click', function ( e ) {
|
||||
if ( !target.active || e.which !== 1 || e.shiftKey || e.altKey || e.ctrlKey || e.metaKey ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( target.getSurface() && !target.deactivating ) {
|
||||
target.editSource();
|
||||
|
||||
if ( target.getSurface().getModel().hasBeenModified() || target.fromEditedState ) {
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
$( '#ca-viewsource, #ca-edit' ).on( 'click', function ( e ) {
|
||||
if ( !target.active || e.which !== 1 || e.shiftKey || e.altKey || e.ctrlKey || e.metaKey ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( target.getSurface() && !target.deactivating ) {
|
||||
target.editSource();
|
||||
|
||||
if ( target.getSurface().getModel().hasBeenModified() || target.fromEditedState ) {
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
mw.hook( 've.skinTabSetupComplete' ).fire();
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue