Fix section area adding
This commit is contained in:
@@ -45,8 +45,9 @@
|
|||||||
close: ->
|
close: ->
|
||||||
if close = @get('modal_options.close')
|
if close = @get('modal_options.close')
|
||||||
close.apply(@)
|
close.apply(@)
|
||||||
|
unless @preventClose
|
||||||
@set 'alert_message', ''
|
@set 'alert_message', ''
|
||||||
@send 'closeModal' unless @preventClose
|
@send 'closeModal'
|
||||||
closeOnOverlay: ->
|
closeOnOverlay: ->
|
||||||
@send('close') if @get('modal_options.closeOnOverlay')
|
@send('close') if @get('modal_options.closeOnOverlay')
|
||||||
false
|
false
|
||||||
@@ -63,6 +64,9 @@
|
|||||||
if @get('model.isValid')
|
if @get('model.isValid')
|
||||||
@get('model').save().then @save_success.bind(@), @save_error.bind(@)
|
@get('model').save().then @save_success.bind(@), @save_error.bind(@)
|
||||||
#@send 'closeModal' unless @preventClose
|
#@send 'closeModal' unless @preventClose
|
||||||
|
rollback_and_close: ->
|
||||||
|
@get('model').rollbackAttributes()
|
||||||
|
@send 'close'
|
||||||
destroyRecord: ->
|
destroyRecord: ->
|
||||||
my_scope = @
|
my_scope = @
|
||||||
destroy_callback = @get('modal_options.destroy_callback')
|
destroy_callback = @get('modal_options.destroy_callback')
|
||||||
|
|||||||
+1
-9
@@ -34,9 +34,7 @@ App.SectionController = Ember.Controller.extend
|
|||||||
@get('model').destroyRecord()
|
@get('model').destroyRecord()
|
||||||
@transitionToRoute 'sections'
|
@transitionToRoute 'sections'
|
||||||
addSectionElement: ->
|
addSectionElement: ->
|
||||||
@modal 'add_section_element',
|
@modal 'add_section_element', model: @get('model')
|
||||||
model: @get('model')
|
|
||||||
ok: => @send 'makeEditable'
|
|
||||||
addSectionArea: ->
|
addSectionArea: ->
|
||||||
section_area = @store.createRecord('section-area')
|
section_area = @store.createRecord('section-area')
|
||||||
section_area.set 'section', @get('model')
|
section_area.set 'section', @get('model')
|
||||||
@@ -44,12 +42,6 @@ App.SectionController = Ember.Controller.extend
|
|||||||
@modal 'section_area',
|
@modal 'section_area',
|
||||||
title_path: 'section_area.add_button'
|
title_path: 'section_area.add_button'
|
||||||
model: section_area
|
model: section_area
|
||||||
ok: => @send 'makeEditable'
|
|
||||||
close: =>
|
|
||||||
if section_area.get('isNew')
|
|
||||||
section_area.deleteRecord()
|
|
||||||
else
|
|
||||||
section_area.rollbackAttributes()
|
|
||||||
textures: ['wood1', 'wood2']
|
textures: ['wood1', 'wood2']
|
||||||
|
|
||||||
#sections: (-> @get('controllers.sections.model')).property('controllers.sections.model')
|
#sections: (-> @get('controllers.sections.model')).property('controllers.sections.model')
|
||||||
@@ -26,7 +26,7 @@ p= t 'section_area.modal.explanation'
|
|||||||
each colors as |color|
|
each colors as |color|
|
||||||
a{action "setColor" color}= colorbox color
|
a{action "setColor" color}= colorbox color
|
||||||
hr
|
hr
|
||||||
button.modal-close{action "close"}=t 'section_area.modal.close_button'
|
button.modal-close{action "rollback_and_close"}=t 'section_area.modal.close_button'
|
||||||
button.modal-confirm.right{action "save"} disabled=model.isInvalid
|
button.modal-confirm.right{action "close"} disabled=model.isInvalid
|
||||||
=t 'section_area.modal.save_button'
|
=t 'section_area.modal.save_button'
|
||||||
button.modal-destroy.right{action "destroyRecord"}= t 'section_area.modal.destroy_button'
|
button.modal-destroy.right{action "destroyRecord"}= t 'section_area.modal.destroy_button'
|
||||||
|
|||||||
@@ -244,8 +244,8 @@ en:
|
|||||||
explanation: |
|
explanation: |
|
||||||
A ${models.section_area} is a block in your ${models.section} to indicate elements to easily recognize your space.
|
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.
|
This can be a Bar or special area.
|
||||||
save_button: Save
|
save_button: OK
|
||||||
close_button: Close
|
close_button: Cancel
|
||||||
destroy_button: Delete
|
destroy_button: Delete
|
||||||
current_employee:
|
current_employee:
|
||||||
my_account:
|
my_account:
|
||||||
|
|||||||
@@ -245,8 +245,8 @@ nl:
|
|||||||
explanation: |
|
explanation: |
|
||||||
A ${models.section_area} is a block in your ${models.section} to indicate elements to easily recognize your space.
|
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.
|
This can be a Bar or special area.
|
||||||
save_button: Save
|
save_button: OK
|
||||||
close_button: Close
|
close_button: Cancel
|
||||||
destroy_button: Verwijderen
|
destroy_button: Verwijderen
|
||||||
current_employee:
|
current_employee:
|
||||||
my_account:
|
my_account:
|
||||||
|
|||||||
Reference in New Issue
Block a user