Merge branch 'master' into 2-0-stable-nov-8th

This commit is contained in:
luisramos0
2018-11-08 11:18:54 +00:00
101 changed files with 4970 additions and 760 deletions

View File

@@ -25,12 +25,14 @@
#= require angular-flash.min.js
#
#= require moment
#= require moment/de.js
#= require moment/en-gb.js
#= require moment/es.js
#= require moment/fr.js
#= require moment/it.js
#= require moment/nb.js
#= require moment/pt-br.js
#= require moment/pt.js
#= require moment/sv.js
#
#= require modernizr

View File

@@ -0,0 +1,29 @@
# Extend the "offCanvasWrap" directive in "angular-foundation" to disable hiding of the off-canvas
# upon window resize.
#
# In some browsers for mobile devices, the address bar is automatically hidden when scrolling down
# the page. This is not workable if the height of the contents of the off-canvas exceeds the height
# of the screen, because the latter portion of the contents stays hidden to the user.
#
# However, for screens over 1024px width for which the off-canvas is not styled to be visible, we
# can proceed to hide this.
#
# https://github.com/openfoodfoundation/angular-foundation/blob/0.9.0-20180826174721/src/offcanvas/offcanvas.js
angular.module('mm.foundation.offcanvas').directive 'offCanvasWrap', ($window) ->
{
restrict: 'C'
priority: 1
link: ($scope, element, attrs) ->
win = angular.element($window)
# Get the scope used by the "offCanvasWrap" directive:
# https://github.com/openfoodfoundation/angular-foundation/blob/0.9.0-20180826174721/src/offcanvas/offcanvas.js#L2
isolatedScope = element.isolateScope()
# Unbind hiding of the off-canvas upon window resize.
win.unbind('resize.body', isolatedScope.hide)
# Bind hiding of the off-canvas that only happens when screen width is over 1024px.
win.bind 'resize.body', ->
isolatedScope.hide() if $(window).width() > 1024
}