jenkins-bot has submitted this change and it was merged.
Change subject: mediawiki.notify: Simplify callback by using .then()
......................................................................
mediawiki.notify: Simplify callback by using .then()
Change-Id: Ifff25534d716721ff1d2d4484dbd0f63161ecb43
---
M resources/src/mediawiki/mediawiki.notify.js
1 file changed, 7 insertions(+), 8 deletions(-)
Approvals:
Krinkle: Looks good to me, approved
jenkins-bot: Verified
diff --git a/resources/src/mediawiki/mediawiki.notify.js
b/resources/src/mediawiki/mediawiki.notify.js
index 743d651..c1e1dab 100644
--- a/resources/src/mediawiki/mediawiki.notify.js
+++ b/resources/src/mediawiki/mediawiki.notify.js
@@ -1,7 +1,7 @@
/**
* @class mw.plugin.notify
*/
-( function ( mw, $ ) {
+( function ( mw ) {
'use strict';
/**
@@ -11,13 +11,12 @@
* @return {jQuery.Promise}
*/
mw.notify = function ( message, options ) {
- var d = $.Deferred();
// Don't bother loading the whole notification system if we
never use it.
- mw.loader.using( 'mediawiki.notification', function () {
- // Call notify with the notification the user requested
of us.
- d.resolve( mw.notification.notify( message, options ) );
- }, d.reject );
- return d.promise();
+ return mw.loader.using( 'mediawiki.notification' )
+ .then( function () {
+ // Call notify with the notification the user
requested of us.
+ return mw.notification.notify( message, options
);
+ } );
};
/**
@@ -25,4 +24,4 @@
* @mixins mw.plugin.notify
*/
-}( mediaWiki, jQuery ) );
+}( mediaWiki ) );
--
To view, visit https://gerrit.wikimedia.org/r/152839
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ifff25534d716721ff1d2d4484dbd0f63161ecb43
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Gerrit Patch Uploader <[email protected]>
Gerrit-Reviewer: Daniel Friesen <[email protected]>
Gerrit-Reviewer: Gerrit Patch Uploader <[email protected]>
Gerrit-Reviewer: Jack Phoenix <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits