aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/coffee/issues/workspace-header-view.coffee
blob: 69e31378baef240d16e6c25a3b3a6454c63bbf2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
define [
  'components/navigator/workspace-header-view'
  'templates/issues'
], (
  WorkspaceHeaderView
) ->

  $ = jQuery


  class extends WorkspaceHeaderView
    template: Templates['issues-workspace-header']


    events: ->
      _.extend super,
        'click .js-back': 'returnToList'
        'click .js-new-search': 'newSearch'


    initialize: ->
      super
      @_onBulkIssues = window.onBulkIssues
      window.onBulkIssues = =>
        $('#modal').dialog 'close'
        @options.app.controller.fetchList()


    onClose: ->
      window.onBulkIssues = @_onBulkIssues


    returnToList: ->
      @options.app.controller.closeComponentViewer()


    newSearch: ->
      @options.app.controller.newSearch()


    bulkChange: ->
      query = @options.app.controller.getQuery '&', true
      url = "#{baseUrl}/issues/bulk_change_form?#{query}"
      openModalWindow url, {}