mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 06:24:08 +00:00
Merge "DesktopArticleTarget.init: Get $targetContainer after jQuery ready"
This commit is contained in:
commit
b00c52556b
|
@ -39,10 +39,8 @@
|
||||||
plugins = [],
|
plugins = [],
|
||||||
welcomeDialogDisabled = false,
|
welcomeDialogDisabled = false,
|
||||||
educationPopupsDisabled = false,
|
educationPopupsDisabled = false,
|
||||||
$targetContainer = $(
|
// Defined after document-ready below
|
||||||
document.querySelector( '[data-mw-ve-target-container]' ) ||
|
$targetContainer = null;
|
||||||
document.getElementById( 'content' )
|
|
||||||
);
|
|
||||||
|
|
||||||
function showLoading( /* mode */ ) {
|
function showLoading( /* mode */ ) {
|
||||||
if ( isLoading ) {
|
if ( isLoading ) {
|
||||||
|
@ -778,9 +776,6 @@
|
||||||
var pageCanLoadEditor = isViewPage || isEditPage;
|
var pageCanLoadEditor = isViewPage || isEditPage;
|
||||||
var pageIsProbablyEditable = mw.config.get( 'wgIsProbablyEditable' ) ||
|
var pageIsProbablyEditable = mw.config.get( 'wgIsProbablyEditable' ) ||
|
||||||
mw.config.get( 'wgRelevantPageIsProbablyEditable' );
|
mw.config.get( 'wgRelevantPageIsProbablyEditable' );
|
||||||
if ( pageCanLoadEditor ) {
|
|
||||||
$targetContainer.addClass( 've-init-mw-desktopArticleTarget-targetContainer' );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Cast "0" (T89513)
|
// Cast "0" (T89513)
|
||||||
var enable = !!+mw.user.options.get( 'visualeditor-enable' );
|
var enable = !!+mw.user.options.get( 'visualeditor-enable' );
|
||||||
|
@ -1508,6 +1503,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
$( function () {
|
$( function () {
|
||||||
|
$targetContainer = $(
|
||||||
|
document.querySelector( '[data-mw-ve-target-container]' ) ||
|
||||||
|
document.getElementById( 'content' )
|
||||||
|
);
|
||||||
|
if ( pageCanLoadEditor ) {
|
||||||
|
$targetContainer.addClass( 've-init-mw-desktopArticleTarget-targetContainer' );
|
||||||
|
}
|
||||||
|
|
||||||
var showWikitextWelcome = true,
|
var showWikitextWelcome = true,
|
||||||
section = parseSection( uri.query.section );
|
section = parseSection( uri.query.section );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue