Re-fix in-page loading

Probably broken by Ie808bcaa
Partially reverts Icad04dac, hopefully without any regressions

Change-Id: I4589bde7eac58b54027a6b9dbe6ecddf79780599
This commit is contained in:
Alex Monk 2015-11-20 01:47:22 +00:00 committed by Alex Monk
parent 360cdacd4b
commit a0462d69d4

View file

@ -18,8 +18,8 @@
* @singleton
*/
( function () {
var conf, tabMessages, uri, pageExists, viewUri, veEditUri, pageCanLoadVE, init,
support, targetPromise, enable, tempdisable, autodisable, userPrefEnabled,
var conf, tabMessages, uri, pageExists, viewUri, veEditUri, isViewPage, pageCanLoadVE,
init, support, targetPromise, enable, tempdisable, autodisable, userPrefEnabled,
initialWikitext,
active = false,
progressStep = 0,
@ -223,8 +223,9 @@
uri = new mw.Uri();
pageExists = !!mw.config.get( 'wgRelevantArticleId' );
viewUri = new mw.Uri( mw.util.getUrl( mw.config.get( 'wgRelevantPageName' ) ) );
isViewPage = mw.config.get( 'wgIsArticle' ) && !( 'diff' in uri.query );
pageCanLoadVE = (
( mw.config.get( 'wgIsArticle' ) && !( 'diff' in uri.query ) ) ||
isViewPage ||
mw.config.get( 'wgAction' ) === 'edit' ||
mw.config.get( 'wgAction' ) === 'submit'
);
@ -562,7 +563,7 @@
} );
} );
} );
} else if ( wikitext ) {
} else if ( isViewPage || wikitext ) {
activatePageTarget();
} else {
location.href = veEditUri;