mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 22:35:41 +00:00
mw.ViewPageTarget.init: Fix pageExists/isViewPage behaviour
"Let me clarify this for you" - Timo
Follows-up 1984c3ca46
.
Bug: 49000
Change-Id: Ia094aa9aae1da1ba11dbaef827e305cbcf08f9b4
This commit is contained in:
parent
1984c3ca46
commit
87bfe3ee09
|
@ -53,13 +53,12 @@
|
|||
|
||||
conf = mw.config.get( 'wgVisualEditorConfig' );
|
||||
uri = new mw.Uri();
|
||||
// For non-article pages, no information about page existence is exposed to
|
||||
// For special pages, no information about page existence is exposed to
|
||||
// mw.config, so we assume it exists TODO: fix this in core.
|
||||
pageExists = !!mw.config.get( 'wgArticleId' ) || !mw.config.get( 'wgIsArticle' );
|
||||
pageExists = !!mw.config.get( 'wgArticleId' ) || mw.config.get( 'wgNamespaceNumber' ) < 0;
|
||||
viewUri = new mw.Uri( mw.util.wikiGetlink( mw.config.get( 'wgRelevantPageName' ) ) );
|
||||
veEditUri = viewUri.clone().extend( { 'veaction': 'edit' } );
|
||||
isViewPage = (
|
||||
mw.config.get( 'wgAction' ) === 'view' &&
|
||||
mw.config.get( 'wgIsArticle' ) &&
|
||||
!( 'diff' in uri.query )
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue