mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-15 23:57:48 +00:00
Add commented-out scrolling code. Return false from click handlers.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "hubModal", ($modal)->
|
||||
Darkswarm.directive "hubModal", ($modal, $document)->
|
||||
restrict: 'E'
|
||||
replace: true
|
||||
template: "<a>{{enterprise.name}}</a>"
|
||||
@@ -6,3 +6,5 @@ Darkswarm.directive "hubModal", ($modal)->
|
||||
elem.on "click", (ev)=>
|
||||
ev.stopPropagation()
|
||||
scope.modalInstance = $modal.open(controller: ctrl, templateUrl: 'hub_modal.html', scope: scope)
|
||||
#$document.scrollTo 0, 0
|
||||
false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "ofnModal", ($modal)->
|
||||
Darkswarm.directive "ofnModal", ($modal, $document)->
|
||||
# Generic modal! Uses transclusion so designer-types can do stuff like:
|
||||
# %ofn-modal
|
||||
# CONTENT
|
||||
@@ -17,3 +17,5 @@ Darkswarm.directive "ofnModal", ($modal)->
|
||||
elem.on "click", =>
|
||||
transclude scope, (clone)->
|
||||
scope.modalInstance = $modal.open(controller: ctrl, template: clone, scope: scope)
|
||||
#$document.scrollTo 0, 0
|
||||
false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "producerModal", ($modal)->
|
||||
Darkswarm.directive "producerModal", ($modal, $document)->
|
||||
restrict: 'E'
|
||||
replace: true
|
||||
template: "<a ng-transclude></a>"
|
||||
@@ -7,4 +7,5 @@ Darkswarm.directive "producerModal", ($modal)->
|
||||
elem.on "click", (ev)=>
|
||||
ev.stopPropagation()
|
||||
scope.modalInstance = $modal.open(controller: ctrl, templateUrl: 'producer_modal.html', scope: scope)
|
||||
|
||||
#$document.scrollTo 0, 0
|
||||
false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.factory "MapModal", ($modal, $rootScope)->
|
||||
Darkswarm.factory "MapModal", ($modal, $rootScope, $document)->
|
||||
new class MapModal
|
||||
open: (enterprise)->
|
||||
scope = $rootScope.$new(true) # Spawn an isolate to contain the enterprise
|
||||
@@ -7,6 +7,9 @@ Darkswarm.factory "MapModal", ($modal, $rootScope)->
|
||||
if enterprise.is_distributor
|
||||
scope.hub = enterprise
|
||||
$modal.open(templateUrl: "hub_modal.html", scope: scope)
|
||||
#$document.scrollTo 0, 0
|
||||
|
||||
else
|
||||
scope.producer = enterprise
|
||||
$modal.open(templateUrl: "map_modal_producer.html", scope: scope)
|
||||
#$document.scrollTo 0, 0
|
||||
|
||||
Reference in New Issue
Block a user