From 636933a95540e39748b1e4967d16c194634667d4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Je=CC=81re=CC=81my=20Fabre?= Date: Tue, 26 Jul 2016 16:46:06 +0200 Subject: [PATCH] Fix sticky-kit bottomed elements --- app/static/src/js/modules/sticky-kit-init.js | 7 +++++ app/templates/pages/page.html | 30 +++++++++----------- 2 files changed, 20 insertions(+), 17 deletions(-) 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 %}
-- 2.39.5