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:
Alex Monk 2016-01-28 02:29:11 +00:00 committed by Jforrester
parent de5f372ac5
commit 8cc034b9af

View file

@ -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();
};