mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-23 22:13:34 +00:00
Handle view tab clicks even on edit pages
This allows the proper "discard changes" dialog to show. A few more steps of the teardown now happen in the client, but eventually in DesktopArticleTarget#teardown we check again if we weren't on a view page and redirect (as this is what we do after save). Bug: T379367 Change-Id: I995649f37e5d841b6c1784a74f3bd353adfbe69f
This commit is contained in:
parent
d414ced79c
commit
b8f032d266
|
@ -889,7 +889,6 @@ ve.init.mw.DesktopArticleTarget.prototype.onToolbarMetaButtonClick = function ()
|
|||
* 'Edit' and single edit tab are bound in mw.DesktopArticleTarget.init.
|
||||
*/
|
||||
ve.init.mw.DesktopArticleTarget.prototype.setupSkinTabs = function () {
|
||||
if ( this.isViewPage ) {
|
||||
const namespaceNumber = mw.config.get( 'wgNamespaceNumber' );
|
||||
const namespaceName = mw.config.get( 'wgCanonicalNamespace' );
|
||||
const isTalkNamespace = mw.Title.isTalkNamespace( namespaceNumber );
|
||||
|
@ -905,10 +904,8 @@ ve.init.mw.DesktopArticleTarget.prototype.setupSkinTabs = function () {
|
|||
} else {
|
||||
namespaceTabId = 'ca-nstab-' + namespaceKey;
|
||||
}
|
||||
// Allow instant switching back to view mode, without refresh
|
||||
$( '#ca-view' ).add( '#' + namespaceTabId ).find( 'a' )
|
||||
.on( 'click.ve-target', this.onViewTabClick.bind( this ) );
|
||||
}
|
||||
|
||||
// Used by Extension:GuidedTour
|
||||
mw.hook( 've.skinTabSetupComplete' ).fire();
|
||||
|
|
Loading…
Reference in a new issue