Fix section area adding
This commit is contained in:
@@ -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')
|
||||
|
||||
+1
-9
@@ -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'
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user