Files
openfoodnetwork/app/assets/javascripts/darkswarm/directives/active_selector.js.coffee
2014-07-10 11:38:17 +10:00

13 lines
326 B
CoffeeScript

Darkswarm.directive "activeSelector", ->
restrict: 'E'
transclude: true
replace: true
templateUrl: 'active_selector.html'
link: (scope, elem, attr)->
scope.selector.emit = scope.emit
elem.bind "click", ->
scope.$apply ->
scope.selector.active = !scope.selector.active
scope.emit()