mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
19 lines
813 B
CoffeeScript
19 lines
813 B
CoffeeScript
angular.module("ofn.admin").directive "ofnToggleVariants", (DisplayProperties) ->
|
|
link: (scope, element, attrs) ->
|
|
if DisplayProperties.showVariants scope.product.id
|
|
element.removeClass "icon-chevron-right"
|
|
element.addClass "icon-chevron-down"
|
|
else
|
|
element.removeClass "icon-chevron-down"
|
|
element.addClass "icon-chevron-right"
|
|
|
|
element.on "click", ->
|
|
scope.$apply ->
|
|
if DisplayProperties.showVariants scope.product.id
|
|
DisplayProperties.setShowVariants scope.product.id, false
|
|
element.removeClass "icon-chevron-down"
|
|
element.addClass "icon-chevron-right"
|
|
else
|
|
DisplayProperties.setShowVariants scope.product.id, true
|
|
element.removeClass "icon-chevron-right"
|
|
element.addClass "icon-chevron-down" |