Files
openfoodnetwork/app/assets/javascripts/admin/directives/track_master.js.coffee
Rohan Mitchell 65895752da Remove cruft
2016-04-29 11:49:30 +10:00

9 lines
373 B
CoffeeScript

angular.module("ofn.admin").directive "ofnTrackMaster", (DirtyProducts) ->
require: "ngModel"
link: (scope, element, attrs, ngModel) ->
ngModel.$parsers.push (viewValue) ->
if ngModel.$dirty
DirtyProducts.addMasterProperty scope.product.id, scope.product.master.id, attrs.ofnTrackMaster, viewValue
scope.displayDirtyProducts()
viewValue