Phuedx has uploaded a new change for review.
https://gerrit.wikimedia.org/r/246462
Change subject: Use Dependency Injection in WatchstarPageList
......................................................................
Use Dependency Injection in WatchstarPageList
Allow the WatchstarApi dependency to be injected at construction time
while maintaining backwards compatibility with existing clients.
Change-Id: I2668c05290b9284bbfab89a55753cca5a9911dbc
---
M resources/mobile.pagelist.scripts/WatchstarPageList.js
1 file changed, 11 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/62/246462/1
diff --git a/resources/mobile.pagelist.scripts/WatchstarPageList.js
b/resources/mobile.pagelist.scripts/WatchstarPageList.js
index 8526554..fc67ec3 100644
--- a/resources/mobile.pagelist.scripts/WatchstarPageList.js
+++ b/resources/mobile.pagelist.scripts/WatchstarPageList.js
@@ -18,10 +18,19 @@
*/
WatchstarPageList = PageList.extend( {
/**
- * @inheritdoc
+ * See {@link PageList#initialize} for more configuration
options.
+ *
+ * @param {Object} options
+ * @param {WatchstarApi} options.api If present, this instance
+ * of `WatchstarApi` is used, otherwise a new instance is
+ * constructed
*/
initialize: function ( options ) {
- this.api = new WatchstarApi( options );
+
+ // FIXME: Shouldn't the WatchstarApi options be
+ // distinct from the general options?
+ this.api = options.api || new WatchstarApi( options );
+
PageList.prototype.initialize.apply( this, arguments );
},
/**
--
To view, visit https://gerrit.wikimedia.org/r/246462
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2668c05290b9284bbfab89a55753cca5a9911dbc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Phuedx <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits