Settings saving feedback
This commit is contained in:
@@ -3,7 +3,9 @@ App.SettingsController = Ember.ObjectController.extend
|
||||
# model: (-> @get('controllers.application.supplier')).property('controllers.application.supplier')
|
||||
time_zones: (-> window.time_zones ).property()
|
||||
countries: (-> window.countries ).property()
|
||||
saving: false
|
||||
editIensProfile: (-> @get('model.country') is 'Netherlands' ).property('model.country')
|
||||
actions:
|
||||
saveSettings: ->
|
||||
@get('model').save()
|
||||
@set 'saving', true
|
||||
@get('model').save().then (supplier) => @set 'saving', false
|
||||
|
||||
@@ -2,7 +2,7 @@ attr = DS.attr
|
||||
App.ProductOrder = DS.Model.extend
|
||||
quantity: attr 'number', defaultValue: 1
|
||||
price: attr 'number'
|
||||
product: DS.belongsTo('product')
|
||||
product: DS.belongsTo('product', async: true)
|
||||
order: DS.belongsTo('order')
|
||||
increment: ->
|
||||
@set('quantity', @get('quantity') + 1)
|
||||
|
||||
@@ -37,4 +37,9 @@ if editIensProfile
|
||||
= image_tag 'supplier/settings/iens-example.png'
|
||||
span=t "settings.reviews.explanation"
|
||||
.form-row.form-actions
|
||||
button.button.submit-supplier-settings{action 'saveSettings'}=t 'settings.save'
|
||||
if saving
|
||||
button.button.submit-supplier-settings.disabled
|
||||
= t 'settings.save'
|
||||
span.fa.fa-lg.fa-spinner.fa-spin
|
||||
else
|
||||
button.button.submit-supplier-settings{action 'saveSettings'}=t 'settings.save'
|
||||
|
||||
Reference in New Issue
Block a user