Fixes and simplifications
This commit is contained in:
@@ -4,4 +4,4 @@ App.ButtonCloseListComponent = Ember.Component.extend
|
||||
classNameBindings: ['content.active:show:hide']
|
||||
tagName: 'button'
|
||||
click: (e)->
|
||||
@get('targetObject').modal 'close_list', model: @get('content')
|
||||
@modal 'close_list', model: @get('content')
|
||||
|
||||
@@ -32,7 +32,7 @@ App.MenuProductComponent = Ember.Component.extend
|
||||
if product.get('isNew')
|
||||
product.deleteRecord()
|
||||
else
|
||||
@get('targetObject').modal 'confirm',
|
||||
@modal 'confirm',
|
||||
model: product
|
||||
title_path: 'product.destroy_confirmation'
|
||||
ok: -> product.destroyRecord()
|
||||
|
||||
@@ -29,6 +29,6 @@ App.SectionAreaComponent = Ember.Component.extend DragNDrop.Draggable,
|
||||
position_y: position.top / dpm
|
||||
click: ->
|
||||
return unless @get('targetObject.editmode')
|
||||
@get('targetObject').modal 'section_area',
|
||||
@modal 'section_area',
|
||||
title_path: 'section_area.modal.title'
|
||||
model: @get('section_area')
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
ComponentExtensions = Ember.Mixin.create
|
||||
modal: (name, options={})->
|
||||
target = App.__container__.lookup('route:application')
|
||||
target.send "openModal", name, options
|
||||
|
||||
Ember.Component.reopen ComponentExtensions
|
||||
Reference in New Issue
Block a user