Adding working modals

This commit is contained in:
Will Marshall
2014-05-21 14:09:48 +10:00
parent a16f726377
commit 0140472fbc
5 changed files with 12 additions and 7 deletions

View File

@@ -6,4 +6,6 @@ Darkswarm.controller "ProductNodeCtrl", ($scope) ->
else
$scope.product.price
$scope.producer = $scope.product.supplier
$scope.hasVariants = $scope.product.variants.length > 0

View File

@@ -8,7 +8,10 @@ Darkswarm.directive "ofnModal", ($modal)->
link: (scope, elem, attrs, ctrl, transclude)->
scope.title = attrs.title
contents = null
transclude scope, (clone)->
# We're using an isolate scope, which is a child of the original scope
# We have to compile the transclude against the original scope, not the isolate
transclude scope.$parent, (clone)->
contents = clone
elem.on "click", =>

View File

@@ -1,10 +1,9 @@
%ofn-modal{title: "{{ producer.name }}"}
#producer_modal{bindonce: true}
#producer_modal
.row
.small-12.columns
%img{"bo-src" => "producer.promo_image"}
%img{"ng-src" => "producer.promo_image"}
%h3 {{ producer.name }}
.row
.small-6.columns
%p

View File

@@ -1,2 +1,4 @@
%ofn-modal{title: "{{product.name}}"}
{{ product | json }}
{{ product.description }}

View File

@@ -6,11 +6,10 @@
%img{"bo-src" => "product.primary_taxon.icon",
"ng-click" => "ordering.order = 'primary_taxon.name'",
name: "{{product.primary_taxon.name}}"}
{{ product.name}}
-#= render partial: "shop/products/modal"
= render partial: "modals/product"
.small-5.columns.summary-header
{{ product.supplier.name }}
= render partial: "modals/producer"
.small-2.columns.summary-price.text-right.price
%span{"ng-if" => "hasVariants"}