diff options
Diffstat (limited to 'server/sonar-web/src/main/es6/dashboard/views/widget-view.js')
-rw-r--r-- | server/sonar-web/src/main/es6/dashboard/views/widget-view.js | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/server/sonar-web/src/main/es6/dashboard/views/widget-view.js b/server/sonar-web/src/main/es6/dashboard/views/widget-view.js deleted file mode 100644 index 0507d5933b4..00000000000 --- a/server/sonar-web/src/main/es6/dashboard/views/widget-view.js +++ /dev/null @@ -1,45 +0,0 @@ -define([ - 'backbone.marionette', - 'templates/dashboard' -], function (Marionette, Templates) { - - var $ = jQuery; - - - class WidgetView extends Marionette.ItemView { - - initialize() { - this.requestContent(); - } - - requestContent() { - var props = this.getWidgetProps(); - $.get(`${baseUrl}/widget/show?id=${this.model.id}&${props}`, (html) => { - this.model.set('html', html); - this.render(); - }); - } - - getWidgetProps() { - var props = this.model.get('props') - .map(function (prop) { - return `${prop.key}=${encodeURIComponent(prop.value)}`; - }) - .join('&'); - return props; - } - - serializeData() { - var props = this.getWidgetProps(); - return _.extend(super.serializeData(), { - url: `${baseUrl}/widget?id=${this.model.id}&${props}` - }); - } - - } - - WidgetView.prototype.template = Templates['widget'] - - return WidgetView; - -}); |