Sha256: 093000157041ee995f397ed6e261c5ac08ccb0c5e147088822884647aec6453d

Contents?: true

Size: 1.21 KB

Versions: 16

Compression:

Stored size: 1.21 KB

Contents

Dashboard.ChannelsTabController = Ember.ArrayController.extend Dashboard.SearchableBaseController, Dashboard.PaginableControllerMixin,
  baseRouteName: 'channels'

  defaultSearchFields:
    query: null

  actions:
    changeState: (channel, action)->
      channelUrl = Dashboard.ApplicationAdapter.prototype.buildURL('channels', channel.id)

      $.ajax url: "#{channelUrl}/#{action}", type: 'PUT'

      @get('target').send('refresh')

    destroy: (channel)->
      if window.confirm(Ember.I18n.t('words.are_you_sure_to_delete'))
        channel.destroyRecord()

        @removeObjects(channel)

Dashboard.ChannelsSearchController = Dashboard.ChannelsTabController.extend Dashboard.SearchableController,
  baseRouteName: 'channels'

Dashboard.ChannelsEditController = Ember.ObjectController.extend
  actions:
    save: ->
      channel = @get('model')

      channel.save()
        .then =>
          @transitionToRoute 'channels'
        .catch (errors)->
          console.log errors
          # must supply catch promise, otherwise Ember will throw a
          # 'backend rejected the commit' error.

    cancel: ->
      @transitionToRoute('channels')

Dashboard.ChannelsNewController = Dashboard.ChannelsEditController.extend()

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
dune-dashboard-1.1.5 app/assets/javascripts/controllers/channels.coffee
dune-dashboard-1.1.4 app/assets/javascripts/controllers/channels.coffee
dune-dashboard-1.1.3 app/assets/javascripts/controllers/channels.coffee
dune-dashboard-1.1.2 app/assets/javascripts/controllers/channels.coffee
dune-dashboard-1.1.1 app/assets/javascripts/controllers/channels.coffee
dune-dashboard-1.1.0 app/assets/javascripts/controllers/channels.coffee
dune-dashboard-1.0.9 app/assets/javascripts/controllers/channels.coffee
dune-dashboard-1.0.8 app/assets/javascripts/controllers/channels.coffee
dune-dashboard-1.0.7 app/assets/javascripts/controllers/channels.coffee
dune-dashboard-1.0.6 app/assets/javascripts/controllers/channels.coffee
dune-dashboard-1.0.5 app/assets/javascripts/controllers/channels.coffee
dune-dashboard-1.0.4 app/assets/javascripts/controllers/channels.coffee
dune-dashboard-1.0.3 app/assets/javascripts/controllers/channels.coffee
dune-dashboard-1.0.2 app/assets/javascripts/controllers/channels.coffee
dune-dashboard-1.0.1 app/assets/javascripts/controllers/channels.coffee
dune-dashboard-1.0.0 app/assets/javascripts/controllers/channels.coffee