-( function ( mw ) {
+( function () {
/**
* View model for a single saved query
*
* @param {string} label Saved query label
* @param {Object} data Saved query data
* @param {Object} [config] Configuration options
- * @param {boolean} [default] This item is the default
+ * @cfg {boolean} [default] This item is the default
*/
mw.rcfilters.dm.SavedQueryItemModel = function MwRcfiltersDmSavedQueriesModel( id, label, data, config ) {
config = config || {};
/**
* Get an object representing the state of this item
*
- * @returns {Object} Object representing the current data state
+ * @return {Object} Object representing the current data state
* of the object
*/
mw.rcfilters.dm.SavedQueryItemModel.prototype.getState = function () {
return this.data;
};
+ /**
+ * Get the combined data of this item as a flat object of parameters
+ *
+ * @return {Object} Combined parameter data
+ */
+ mw.rcfilters.dm.SavedQueryItemModel.prototype.getCombinedData = function () {
+ return $.extend( true, {}, this.data.params, this.data.highlights );
+ };
+
/**
* Check whether this item is the default
*
this.emit( 'update' );
}
};
-}( mediaWiki ) );
+}() );