mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-13 23:37:47 +00:00
Automatically resizing to fit
This commit is contained in:
@@ -6,4 +6,3 @@ Darkswarm.controller "MapCtrl", ($scope, MapConfiguration, OfnMap)->
|
||||
longitude: 144.743663
|
||||
zoom: 8
|
||||
styles: MapConfiguration.options
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
Darkswarm.directive "fillVertical", ($window)->
|
||||
restrict: 'A'
|
||||
|
||||
link: (scope, element, attrs)->
|
||||
setSize = ->
|
||||
element.css "height", ($window.innerHeight - element.offset().top)
|
||||
setSize()
|
||||
|
||||
angular.element($window).bind "resize", ->
|
||||
setSize()
|
||||
@@ -1,5 +1,7 @@
|
||||
// Place all the styles related to the map controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||
.angular-google-map-container
|
||||
height: 600px
|
||||
.ofn-map-container
|
||||
map, .angular-google-map-container, google-map, .angular-google-map
|
||||
display: block
|
||||
height: 100%
|
||||
|
||||
@@ -3,10 +3,11 @@
|
||||
|
||||
= inject_json "enterprisesForMap" , "enterprises_for_map", collection: @enterprises
|
||||
|
||||
%map{"ng-controller" => "MapCtrl"}
|
||||
%google-map{center: "map.center", zoom: "map.zoom", styles: "map.styles", draggable: "true"}
|
||||
.ofn-map-container{"fill-vertical" => true}
|
||||
%map{"ng-controller" => "MapCtrl"}
|
||||
%google-map{center: "map.center", zoom: "map.zoom", styles: "map.styles", draggable: "true"}
|
||||
|
||||
%markers{models: "OfnMap.enterprises", fit: "true",
|
||||
coords: "'self'", icon: "'icon'", click: "'reveal'"}
|
||||
%markers{models: "OfnMap.enterprises", fit: "true",
|
||||
coords: "'self'", icon: "'icon'", click: "'reveal'"}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user