mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 22:35:41 +00:00
Try to make MW->VE switching failures break less things
* Try to hide loading bar on failure * Don't set wgAction back to 'view' if we're dropping the user back to the wikitext editor Bug: T125580 Change-Id: I13058ae131a1dda3b172e78d9b143d70831c47f1
This commit is contained in:
parent
80124c88a6
commit
4a288a5866
|
@ -33,6 +33,7 @@
|
|||
function showLoading() {
|
||||
var $content, contentRect, offsetTop, windowHeight, top, bottom, middle;
|
||||
|
||||
$( 'html' ).addClass( 've-activated ve-loading' );
|
||||
if ( !init.$loading ) {
|
||||
init.$loading = $(
|
||||
'<div class="ve-init-mw-desktopArticleTarget-loading-overlay">' +
|
||||
|
@ -77,6 +78,7 @@
|
|||
}
|
||||
|
||||
function hideLoading() {
|
||||
$( 'html' ).removeClass( 've-activated ve-loading' );
|
||||
if ( init.$loading ) {
|
||||
init.$loading.detach();
|
||||
}
|
||||
|
@ -202,13 +204,18 @@
|
|||
modified
|
||||
);
|
||||
} )
|
||||
.done( function () {
|
||||
incrementLoadingProgress();
|
||||
} );
|
||||
.then(
|
||||
function () {
|
||||
incrementLoadingProgress();
|
||||
},
|
||||
function () {
|
||||
hideLoading();
|
||||
resetLoadingProgress();
|
||||
}
|
||||
);
|
||||
|
||||
setEditorPreference( 'visualeditor' );
|
||||
|
||||
$( 'html' ).addClass( 've-activated ve-loading' );
|
||||
showLoading();
|
||||
incrementLoadingProgress();
|
||||
active = true;
|
||||
|
|
|
@ -1066,7 +1066,7 @@ ve.init.mw.DesktopArticleTarget.prototype.restorePage = function () {
|
|||
if ( 'vesection' in uri.query ) {
|
||||
delete uri.query.vesection;
|
||||
}
|
||||
if ( 'action' in uri.query ) {
|
||||
if ( 'action' in uri.query && $( '#wpTextbox1' ).length === 0 ) {
|
||||
delete uri.query.action;
|
||||
mw.config.set( 'wgAction', 'view' );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue