From 8b0e4e5cef8164cec69687964eeaff5bc2664b0d Mon Sep 17 00:00:00 2001 From: Theo Diamantidis Date: Sun, 18 Feb 2018 01:09:20 +0200 Subject: [PATCH] Update footer cookie bar margin on resize --- public/js/app.js | 5 ++++- resources/assets/js/eu-cookie.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/public/js/app.js b/public/js/app.js index fd07435..1ced73b 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -37766,7 +37766,10 @@ $(document).ready(function () { if (readCookie("cookiePrompt") != "on") { $(".cookie-bar").show(); - $("footer").css("margin-bottom", $(".cookie-bar").outerHeight() + "px"); + $("footer").addClass("cookieMargin").css("margin-bottom", $(".cookie-bar").outerHeight() + "px"); + $(window).on("resize", _.debounce(function () { + $("footer.cookieMargin").css("margin-bottom", $(".cookie-bar").outerHeight() + "px"); + })); } $("#accept-cookies").on("click", function (e) { e.preventDefault(); diff --git a/resources/assets/js/eu-cookie.js b/resources/assets/js/eu-cookie.js index e0e2dc9..6e1b64e 100644 --- a/resources/assets/js/eu-cookie.js +++ b/resources/assets/js/eu-cookie.js @@ -32,7 +32,10 @@ $(document).ready(function(){ if(readCookie("cookiePrompt") != "on") { $(".cookie-bar").show() - $("footer").css("margin-bottom", $(".cookie-bar").outerHeight() + "px") + $("footer").addClass("cookieMargin").css("margin-bottom", $(".cookie-bar").outerHeight() + "px") + $(window).on("resize", _.debounce(function() { + $("footer.cookieMargin").css("margin-bottom", $(".cookie-bar").outerHeight() + "px") + })) } $("#accept-cookies").on("click", function(e){ e.preventDefault()