Remove unused controllers
This commit is contained in:
parent
4201b81fe8
commit
d2dd744811
|
@ -1,25 +0,0 @@
|
|||
`import Ember from 'ember'`
|
||||
`import Ajax from 'travis/utils/ajax'`
|
||||
|
||||
Controller = Ember.ObjectController.extend
|
||||
isDeleting: false
|
||||
needs: ['repo', 'caches']
|
||||
repo: Ember.computed.alias('controllers.repo.repo')
|
||||
|
||||
actions:
|
||||
delete: ->
|
||||
return if @get('isDeleting')
|
||||
|
||||
if confirm('Are you sure?')
|
||||
@set('isDeleting', true)
|
||||
|
||||
data = { branch: @get('branch') }
|
||||
|
||||
deletingDone = => @set('isDeleting', false)
|
||||
|
||||
repo = @get('repo')
|
||||
Ajax.ajax("/repos/#{repo.get('id')}/caches", "DELETE", data: data).then(deletingDone, deletingDone).then =>
|
||||
model = @get('model')
|
||||
@get('controllers.caches').removeObject(model)
|
||||
|
||||
`export default Controller`
|
|
@ -1,27 +0,0 @@
|
|||
`import Ember from 'ember'`
|
||||
`import Ajax from 'travis/utils/ajax'`
|
||||
|
||||
Controller = Ember.ObjectController.extend
|
||||
isDeleting: false
|
||||
needs: ['repo', 'caches']
|
||||
repo: Ember.computed.alias('controllers.repo.repo')
|
||||
|
||||
actions:
|
||||
delete: ->
|
||||
return if @get('isDeleting')
|
||||
|
||||
if confirm('Are you sure?')
|
||||
@set('isDeleting', true)
|
||||
|
||||
data = { branch: @get('branch'), match: @get('slug') }
|
||||
|
||||
deletingDone = => @set('isDeleting', false)
|
||||
|
||||
repo = @get('repo')
|
||||
Ajax.ajax("/repos/#{repo.get('id')}/caches", "DELETE", data: data).then(deletingDone, deletingDone).then =>
|
||||
model = @get('model')
|
||||
@get('parent.caches').removeObject(model)
|
||||
if @get('parent.caches.length') == 0
|
||||
@get('controllers.caches').removeObject(@get('parent'))
|
||||
|
||||
`export default Controller`
|
Loading…
Reference in New Issue
Block a user