diff options
Diffstat (limited to 'plugins/Dashboard/javascripts/dashboardWidget.js')
-rw-r--r-- | plugins/Dashboard/javascripts/dashboardWidget.js | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/plugins/Dashboard/javascripts/dashboardWidget.js b/plugins/Dashboard/javascripts/dashboardWidget.js index 749459005a..9d10183b19 100644 --- a/plugins/Dashboard/javascripts/dashboardWidget.js +++ b/plugins/Dashboard/javascripts/dashboardWidget.js @@ -146,10 +146,21 @@ } // Reading segment from hash tag (standard case) or from the URL (when embedding dashboard) - var segment = broadcast.getValueFromHash('segment') || broadcast.getValueFromUrl('segment'); - if (segment.length) { - this.widgetParameters.segment = segment; - } + ['segment'].forEach(function (paramName) { + var value = broadcast.getValueFromHash(paramName) || broadcast.getValueFromUrl(paramName); + if (value.length) { + self.widgetParameters[paramName] = value; + } + }); + + ['compareSegments', 'comparePeriods', 'compareDates'].forEach(function (paramName) { + var value = broadcast.getValueFromHash(paramName) || broadcast.getValueFromUrl(paramName); + if (value.length) { + self.widgetParameters[paramName] = value; + } else { + delete self.widgetParameters[paramName]; + } + }); if (!hideLoading) { $('.widgetContent', currentWidget).addClass('loading'); |