Files
openfoodnetwork/app/assets/javascripts/darkswarm/directives/fill_vertical.js.coffee
2021-08-02 18:59:42 +01:00

10 lines
355 B
CoffeeScript

angular.module('Darkswarm').directive "fillVertical", ($window)->
# Makes something fill the window vertically. Used on the Google Map.
restrict: 'A'
link: (scope, element, attrs)->
setSize = ->
element.css "height", ($window.innerHeight - element.offset().top)
setSize()
angular.element($window).bind "resize", ->
setSize()