Fix section area adding

This commit is contained in:
2015-10-11 15:52:39 +02:00
parent 978dfcbf82
commit 5ed5139125
5 changed files with 13 additions and 17 deletions
@@ -45,8 +45,9 @@
close: ->
if close = @get('modal_options.close')
close.apply(@)
@set 'alert_message', ''
@send 'closeModal' unless @preventClose
unless @preventClose
@set 'alert_message', ''
@send 'closeModal'
closeOnOverlay: ->
@send('close') if @get('modal_options.closeOnOverlay')
false
@@ -63,6 +64,9 @@
if @get('model.isValid')
@get('model').save().then @save_success.bind(@), @save_error.bind(@)
#@send 'closeModal' unless @preventClose
rollback_and_close: ->
@get('model').rollbackAttributes()
@send 'close'
destroyRecord: ->
my_scope = @
destroy_callback = @get('modal_options.destroy_callback')
@@ -34,9 +34,7 @@ App.SectionController = Ember.Controller.extend
@get('model').destroyRecord()
@transitionToRoute 'sections'
addSectionElement: ->
@modal 'add_section_element',
model: @get('model')
ok: => @send 'makeEditable'
@modal 'add_section_element', model: @get('model')
addSectionArea: ->
section_area = @store.createRecord('section-area')
section_area.set 'section', @get('model')
@@ -44,12 +42,6 @@ App.SectionController = Ember.Controller.extend
@modal 'section_area',
title_path: 'section_area.add_button'
model: section_area
ok: => @send 'makeEditable'
close: =>
if section_area.get('isNew')
section_area.deleteRecord()
else
section_area.rollbackAttributes()
textures: ['wood1', 'wood2']
#sections: (-> @get('controllers.sections.model')).property('controllers.sections.model')
@@ -26,7 +26,7 @@ p= t 'section_area.modal.explanation'
each colors as |color|
a{action "setColor" color}= colorbox color
hr
button.modal-close{action "close"}=t 'section_area.modal.close_button'
button.modal-confirm.right{action "save"} disabled=model.isInvalid
button.modal-close{action "rollback_and_close"}=t 'section_area.modal.close_button'
button.modal-confirm.right{action "close"} disabled=model.isInvalid
=t 'section_area.modal.save_button'
button.modal-destroy.right{action "destroyRecord"}= t 'section_area.modal.destroy_button'
+2 -2
View File
@@ -244,8 +244,8 @@ en:
explanation: |
A ${models.section_area} is a block in your ${models.section} to indicate elements to easily recognize your space.
This can be a Bar or special area.
save_button: Save
close_button: Close
save_button: OK
close_button: Cancel
destroy_button: Delete
current_employee:
my_account:
+2 -2
View File
@@ -245,8 +245,8 @@ nl:
explanation: |
A ${models.section_area} is a block in your ${models.section} to indicate elements to easily recognize your space.
This can be a Bar or special area.
save_button: Save
close_button: Close
save_button: OK
close_button: Cancel
destroy_button: Verwijderen
current_employee:
my_account: