Fixes and simplifications

This commit is contained in:
2015-08-06 18:20:37 +02:00
parent 0052f97465
commit 74ba0dd27d
7 changed files with 16 additions and 9 deletions
@@ -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