mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-26 20:56:48 +00:00
13 lines
580 B
CoffeeScript
13 lines
580 B
CoffeeScript
Darkswarm.factory "EnterpriseModal", ($modal, $rootScope, $http)->
|
|
# Build a modal popup for an enterprise.
|
|
new class EnterpriseModal
|
|
open: (enterprise)->
|
|
scope = $rootScope.$new(true) # Spawn an isolate to contain the enterprise
|
|
scope.embedded_layout = window.location.search.indexOf("embedded_shopfront=true") != -1
|
|
|
|
$http.get("/api/enterprises/" + enterprise.id + "/shopfront").success (data) ->
|
|
scope.enterprise = data
|
|
$modal.open(templateUrl: "enterprise_modal.html", scope: scope)
|
|
.error (data) ->
|
|
console.error(data)
|