Disabling save button on order page until changes are made to the order

This commit is contained in:
Rob Harrington
2017-04-28 14:42:00 +10:00
parent 314ccc2f27
commit e79a23a554
5 changed files with 16 additions and 4 deletions

View File

@@ -6,7 +6,11 @@ Darkswarm.directive "ofnOnHand", ->
# In cases where this field gets its value from the HTML element rather than the model,
# initialise the model with the HTML value.
if scope.$eval(attr.ngModel) == undefined
ngModel.$setViewValue elem.val()
# Don't dirty the model when we do this
setDirty = ngModel.$setDirty
ngModel.$setDirty = angular.noop
ngModel.$setViewValue(elem.val())
ngModel.$setDirty = setDirty
ngModel.$parsers.push (viewValue) ->
on_hand = parseInt(attr.ofnOnHand)