Bartosz Dziewoński has uploaded a new change for review.
https://gerrit.wikimedia.org/r/185393
Change subject: Wait with showing edit notices until after the welcome dialog
is closed
......................................................................
Wait with showing edit notices until after the welcome dialog is closed
Its white overlay is pretty good at obscuring them, and the notices popup
would close when the dialog is closed, making it very easy to miss them.
Also fixed indentation.
Bug: T86987
Change-Id: I9f93c4169de98ef77a1eb33fd31a0ec524b6d2b7
---
M modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
M modules/ve-mw/ui/tools/ve.ui.MWPopupTool.js
2 files changed, 26 insertions(+), 20 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor
refs/changes/93/185393/1
diff --git a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
index cd1c625..c6efa17 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
@@ -1121,10 +1121,11 @@
*/
ve.init.mw.ViewPageTarget.prototype.attachToolbarSaveButton = function () {
var $actionTools = $( '<div>' ),
- $pushButtons = $( '<div>' ),
- actions = new ve.ui.TargetToolbar( this );
+ $pushButtons = $( '<div>' );
- actions.setup( [
+ this.actionsToolbar = new ve.ui.TargetToolbar( this );
+
+ this.actionsToolbar.setup( [
{ include: [ 'help', 'notices' ] },
{
type: 'list',
@@ -1136,7 +1137,7 @@
$actionTools
.addClass( 've-init-mw-viewPageTarget-toolbar-utilities' )
- .append( actions.$element );
+ .append( this.actionsToolbar.$element );
$pushButtons
.addClass( 've-init-mw-viewPageTarget-toolbar-actions' )
@@ -1596,7 +1597,7 @@
* Show dialogs as needed on load.
*/
ve.init.mw.ViewPageTarget.prototype.maybeShowDialogs = function () {
- var usePrefs, prefSaysShow, urlSaysHide;
+ var usePrefs, prefSaysShow, urlSaysHide, target = this;
if ( mw.config.get( 'wgVisualEditorConfig' ).showBetaWelcome ) {
// Only use the preference value if the user is logged-in.
@@ -1610,17 +1611,27 @@
urlSaysHide = 'vehidebetadialog' in this.currentUri.query;
if (
- !urlSaysHide &&
+ !urlSaysHide &&
+ (
+ prefSaysShow ||
(
- prefSaysShow ||
- (
- !usePrefs &&
- localStorage.getItem(
've-beta-welcome-dialog' ) === null &&
- $.cookie(
've-beta-welcome-dialog' ) === null
- )
+ !usePrefs &&
+ localStorage.getItem(
've-beta-welcome-dialog' ) === null &&
+ $.cookie( 've-beta-welcome-dialog' )
=== null
)
- ) {
- this.getSurface().getDialogs().openWindow(
'betaWelcome' );
+ )
+ ) {
+ this.getSurface().getDialogs().openWindow(
'betaWelcome' ).done( function ( opened ) {
+ opened.done( function ( closing ) {
+ closing.done( function () {
+ // Pop out the notices when the
welcome dialog is closed
+
target.actionsToolbar.tools.notices.getPopup().toggle( true );
+ } );
+ } );
+ } );
+ } else {
+ // Automatically open the notices immediately
+ this.actionsToolbar.tools.notices.getPopup().toggle(
true );
}
if ( prefSaysShow ) {
diff --git a/modules/ve-mw/ui/tools/ve.ui.MWPopupTool.js
b/modules/ve-mw/ui/tools/ve.ui.MWPopupTool.js
index 8a77cd1..f8ad01a 100644
--- a/modules/ve-mw/ui/tools/ve.ui.MWPopupTool.js
+++ b/modules/ve-mw/ui/tools/ve.ui.MWPopupTool.js
@@ -42,12 +42,7 @@
this.popup.$body.append( this.$items );
- // Automatically show
- if ( count ) {
- setTimeout( function () {
- tool.popup.toggle( true );
- }, 500 );
- } else {
+ if ( !count ) {
this.$element = $( [] );
}
};
--
To view, visit https://gerrit.wikimedia.org/r/185393
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9f93c4169de98ef77a1eb33fd31a0ec524b6d2b7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits