From: Jérémy Fabre Date: Tue, 26 Jul 2016 14:46:06 +0000 (+0200) Subject: Fix sticky-kit bottomed elements X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=636933a95540e39748b1e4967d16c194634667d4;p=mezzo.git Fix sticky-kit bottomed elements --- diff --git a/app/static/src/js/modules/sticky-kit-init.js b/app/static/src/js/modules/sticky-kit-init.js index 55d7af53..50ab1031 100644 --- a/app/static/src/js/modules/sticky-kit-init.js +++ b/app/static/src/js/modules/sticky-kit-init.js @@ -18,6 +18,13 @@ StickyKitInit.prototype.init = function() { $('[data-sticky]').each(function(i) { $element = $(this); + $element.on('sticky_kit:bottom', function(e) { + $(this).parent().css('position', 'static'); + }) + .on('sticky_kit:unbottom', function(e) { + $(this).parent().css('position', 'relative'); + }); + data = $(this).data(); if(data.stickyOffset) { diff --git a/app/templates/pages/page.html b/app/templates/pages/page.html index 1b6f2a96..f908ad03 100644 --- a/app/templates/pages/page.html +++ b/app/templates/pages/page.html @@ -28,24 +28,20 @@
-
-
- {% block page_sidebar %} - {% if page.get_ascendants|length < 2 %} - {% page_menu "pages/menus/current_tree_primary.html" %} - {% endif %} - {% if page.get_ascendants|length == 2 %} - {% page_menu "pages/menus/current_tree_secondary.html" %} - {% endif %} - {% endblock %} -
+
+ {% block page_sidebar %} + {% if page.get_ascendants|length < 2 %} + {% page_menu "pages/menus/current_tree_primary.html" %} + {% endif %} + {% if page.get_ascendants|length == 2 %} + {% page_menu "pages/menus/current_tree_secondary.html" %} + {% endif %} + {% endblock %}
-
-
- {% block page_content %} - {{ page.content }} - {% endblock %} -
+
+ {% block page_content %} + {{ page.content }} + {% endblock %}