jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/354026 )

Change subject: Do not hide the toast for the blocked message
......................................................................


Do not hide the toast for the blocked message

This also implements a way for users of the toast module to pass
further options to the mw.notify function, if needed.

Bug: T165513
Change-Id: If31bee9e6d686b311853ba2b37ea4136564ed72c
---
M resources/mobile.startup/toast.js
M resources/skins.minerva.editor/init.js
2 files changed, 20 insertions(+), 6 deletions(-)

Approvals:
  jenkins-bot: Verified
  Jdlrobson: Looks good to me, approved



diff --git a/resources/mobile.startup/toast.js 
b/resources/mobile.startup/toast.js
index be4c083..b402782 100644
--- a/resources/mobile.startup/toast.js
+++ b/resources/mobile.startup/toast.js
@@ -15,13 +15,24 @@
         * Show a message with the given class in a toast.
         * @method
         * @param {string} msg Message to show in the toast
-        * @param {string} cssClass CSS class to add to the element
+        * @param {Object} options CSS class to add to the element if a string. 
If an object, more options for the
+        *  notification, see mw.notification.show. For backwards compatibility 
reasons if a string is given it will be
+        *  treated as options.type
         */
-       Toast.prototype.show = function ( msg, cssClass ) {
-               this.notification = mw.notify( msg, {
-                       type: cssClass,
+       Toast.prototype.show = function ( msg, options ) {
+               if ( typeof options === 'string' ) {
+                       mw.log.warn( 'The use of the cssClass parameter of 
Toast.show is deprecated, please convert it to an ' +
+                               'options object.' );
+                       options = {
+                               type: options
+                       };
+               }
+
+               options = $.extend( {
                        tag: 'toast'
-               } );
+               }, options );
+
+               this.notification = mw.notify( msg, options );
        };
 
        /**
diff --git a/resources/skins.minerva.editor/init.js 
b/resources/skins.minerva.editor/init.js
index 408b144..ac589dd 100644
--- a/resources/skins.minerva.editor/init.js
+++ b/resources/skins.minerva.editor/init.js
@@ -288,7 +288,10 @@
                                                        
'mobile-frontend-editor-blocked-info-loggedin',
                                                        blockInfo.blockReason,
                                                        blockInfo.blockedBy
-                                               )
+                                               ),
+                                               {
+                                                       autoHide: false
+                                               }
                                        );
                                        ev.preventDefault();
                                } );

-- 
To view, visit https://gerrit.wikimedia.org/r/354026
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If31bee9e6d686b311853ba2b37ea4136564ed72c
Gerrit-PatchSet: 9
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com>
Gerrit-Reviewer: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com>
Gerrit-Reviewer: Jdlrobson <jrob...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to