mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-26 20:56:48 +00:00
9 lines
390 B
CoffeeScript
9 lines
390 B
CoffeeScript
angular.module("ofn.admin").directive "ofnTrackVariant", ["DirtyProducts", (DirtyProducts) ->
|
|
require: "ngModel"
|
|
link: (scope, element, attrs, ngModel) ->
|
|
ngModel.$parsers.push (viewValue) ->
|
|
if ngModel.$dirty
|
|
DirtyProducts.addVariantProperty scope.product.id, scope.variant.id, attrs.ofnTrackVariant, viewValue
|
|
scope.displayDirtyProducts()
|
|
viewValue
|
|
] |