Files
openfoodnetwork/app/assets/javascripts/darkswarm/services/map_modal.js.coffee
2014-06-17 12:35:03 +10:00

10 lines
414 B
CoffeeScript

Darkswarm.factory "MapModal", ($modal, $rootScope)->
new class MapModal
open: (enterprise)->
scope = $rootScope.$new(true) # Spawn an isolate to contain the enterprise
scope.enterprise = enterprise
if enterprise['is_primary_producer?']
$modal.open(templateUrl: "map_modal_producer.html", scope: scope)
else
$modal.open(templateUrl: "map_modal_hub.html", scope: scope)