Use save bar on order cycle form

This commit is contained in:
Bing Xie
2016-04-20 15:31:11 +10:00
parent f90e7d3239
commit 38efa218d0
3 changed files with 9 additions and 2 deletions

View File

@@ -12,6 +12,9 @@ angular.module('admin.orderCycles')
$scope.StatusMessage = StatusMessage
$scope.$watch 'order_cycle_form.$dirty', (newValue) ->
StatusMessage.display 'notice', 'You have unsaved changes' if newValue
$scope.loaded = ->
Enterprise.loaded && EnterpriseFee.loaded && OrderCycle.loaded
@@ -81,4 +84,6 @@ angular.module('admin.orderCycles')
OrderCycle.removeDistributionOfVariant(variant_id)
$scope.submit = (destination) ->
StatusMessage.display 'progress', "Saving..."
OrderCycle.update(destination)
this.order_cycle_form.$setPristine()

View File

@@ -1,4 +1,4 @@
#save-bar.animate-show{ ng: { show: 'form.$dirty || StatusMessage.active()' } }
#save-bar.animate-show{ ng: { show: 'StatusMessage.active()' } }
.twelve.columns.alpha
%h5#status-message{ ng: { style: 'StatusMessage.statusMessage.style' } }
{{ StatusMessage.statusMessage.text || " " }}