mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
9 lines
373 B
CoffeeScript
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
|