diff options
Diffstat (limited to 'server/sonar-web/src/main/js/apps/issues/app-new.js')
-rw-r--r-- | server/sonar-web/src/main/js/apps/issues/app-new.js | 94 |
1 files changed, 41 insertions, 53 deletions
diff --git a/server/sonar-web/src/main/js/apps/issues/app-new.js b/server/sonar-web/src/main/js/apps/issues/app-new.js index 07b047bfcd8..061903ae01f 100644 --- a/server/sonar-web/src/main/js/apps/issues/app-new.js +++ b/server/sonar-web/src/main/js/apps/issues/app-new.js @@ -14,69 +14,57 @@ define([ FacetsView, FiltersView) { var $ = jQuery, - App = new Marionette.Application(); + App = new Marionette.Application(), + init = function (options) { + this.state = new State(); + this.list = new Issues(); + this.facets = new Facets(); + this.filters = new Filters(); - App.addInitializer(function () { - this.state = new State(); - this.list = new Issues(); - this.facets = new Facets(); - this.filters = new Filters(); - }); + this.layout = new Layout({ app: this, el: options.el }); + this.layout.render(); + $('#footer').addClass('search-navigator-footer'); - App.addInitializer(function () { - this.layout = new Layout({ app: this }); - $('.issues').empty().append(this.layout.render().el); - $('#footer').addClass('search-navigator-footer'); - }); + this.controller = new Controller({ app: this }); - App.addInitializer(function () { - this.controller = new Controller({ app: this }); - }); + this.issuesView = new WorkspaceListView({ + app: this, + collection: this.list + }); + this.layout.workspaceListRegion.show(this.issuesView); + this.issuesView.bindScrollEvents(); - App.addInitializer(function () { - this.issuesView = new WorkspaceListView({ - app: this, - collection: this.list - }); - this.layout.workspaceListRegion.show(this.issuesView); - this.issuesView.bindScrollEvents(); - }); + this.workspaceHeaderView = new WorkspaceHeaderView({ + app: this, + collection: this.list + }); + this.layout.workspaceHeaderRegion.show(this.workspaceHeaderView); - App.addInitializer(function () { - this.workspaceHeaderView = new WorkspaceHeaderView({ - app: this, - collection: this.list - }); - this.layout.workspaceHeaderRegion.show(this.workspaceHeaderView); - }); + this.facetsView = new FacetsView({ + app: this, + collection: this.facets + }); + this.layout.facetsRegion.show(this.facetsView); - App.addInitializer(function () { - this.facetsView = new FacetsView({ - app: this, - collection: this.facets - }); - this.layout.facetsRegion.show(this.facetsView); - }); + this.filtersView = new FiltersView({ + app: this, + collection: this.filters + }); + this.layout.filtersRegion.show(this.filtersView); - App.addInitializer(function () { - this.filtersView = new FiltersView({ - app: this, - collection: this.filters - }); - this.layout.filtersRegion.show(this.filtersView); - }); + this.controller.fetchFilters().done(function () { + key.setScope('list'); + App.router = new Router({ app: App }); + Backbone.history.start(); + }); + }; - App.addInitializer(function () { - this.controller.fetchFilters().done(function () { - key.setScope('list'); - App.router = new Router({ app: App }); - Backbone.history.start(); + App.on('start', function (options) { + $.when(window.requestMessages()).done(function () { + init.call(App, options); }); }); - var l10nXHR = window.requestMessages(); - return jQuery.when(l10nXHR).done(function () { - return App.start(); - }); + return App; }); |