jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/387799 )
Change subject: Pass Options into FormatterHelper
......................................................................
Pass Options into FormatterHelper
This lets us handle some common options in FormatterHelper’s methods.
Change-Id: I03ac1a2e97058557cd0bda6cd0db0869ad8c5f5d
---
M wikibase/queryService/ui/resultBrowser/AbstractResultBrowser.js
M wikibase/queryService/ui/resultBrowser/helper/FormatterHelper.js
2 files changed, 24 insertions(+), 1 deletion(-)
Approvals:
Smalyshev: Looks good to me, approved
jenkins-bot: Verified
diff --git a/wikibase/queryService/ui/resultBrowser/AbstractResultBrowser.js
b/wikibase/queryService/ui/resultBrowser/AbstractResultBrowser.js
index 13b5d60..adc675f 100644
--- a/wikibase/queryService/ui/resultBrowser/AbstractResultBrowser.js
+++ b/wikibase/queryService/ui/resultBrowser/AbstractResultBrowser.js
@@ -73,6 +73,7 @@
*/
SELF.prototype.setOptions = function( options ) {
this._options = options;
+ this._getFormatter().setOptions( options );
};
/**
diff --git a/wikibase/queryService/ui/resultBrowser/helper/FormatterHelper.js
b/wikibase/queryService/ui/resultBrowser/helper/FormatterHelper.js
index 69fde1b..6b6f4bf 100644
--- a/wikibase/queryService/ui/resultBrowser/helper/FormatterHelper.js
+++ b/wikibase/queryService/ui/resultBrowser/helper/FormatterHelper.js
@@ -36,10 +36,26 @@
* @author Jonas Kress
* @constructor
* @param {Function} _i18n
+ * @param {wikibase.queryService.ui.resultBrowser.helper.Options}
options
*/
- function SELF( _i18n ) {
+ function SELF( _i18n, options ) {
this._i18n = _i18n;
+ this._options = options || new
wikibase.queryService.ui.resultBrowser.helper.Options( {} );
}
+
+ /**
+ * @return {wikibase.queryService.ui.resultBrowser.helper.Options}
+ */
+ SELF.prototype.getOptions = function() {
+ return this._options;
+ };
+
+ /**
+ * @param {wikibase.queryService.ui.resultBrowser.helper.Options}
options
+ */
+ SELF.prototype.setOptions = function( options ) {
+ this._options = options;
+ };
/**
* Format a data row
@@ -461,5 +477,11 @@
*/
SELF.prototype._i18n = null;
+ /**
+ * @property {wikibase.queryService.ui.resultBrowser.helper.Options}
+ * @private
+ */
+ SELF.prototype._options = null;
+
return SELF;
}( jQuery, moment ) );
--
To view, visit https://gerrit.wikimedia.org/r/387799
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I03ac1a2e97058557cd0bda6cd0db0869ad8c5f5d
Gerrit-PatchSet: 2
Gerrit-Project: wikidata/query/gui
Gerrit-Branch: master
Gerrit-Owner: Lucas Werkmeister (WMDE) <[email protected]>
Gerrit-Reviewer: Jonas Kress (WMDE) <[email protected]>
Gerrit-Reviewer: Lucas Werkmeister (WMDE) <[email protected]>
Gerrit-Reviewer: Smalyshev <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits