Files
openfoodnetwork/app/assets/javascripts/darkswarm/services/map_modal.js.coffee
2014-06-19 14:19:11 +10:00

11 lines
445 B
CoffeeScript

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