var CloseEscape = require('./modules/close-escape');
var Search = require('./modules/search');
var OverflowInit = require('./modules/overflow-init');
+var StickyKitInit = require('./modules/sticky-kit-init');
//
// Init all the modules
window[CloseEscape] = new CloseEscape();
window[Search] = new Search();
window[OverflowInit] = new OverflowInit();
+window[StickyKitInit] = new StickyKitInit();
--- /dev/null
+var StickyKitInit = function() {
+
+ //
+ // Init
+ //
+ this.init();
+
+};
+
+StickyKitInit.prototype.init = function() {
+
+ var that = this,
+ options = {},
+ data;
+
+ $('[data-sticky]').each(function(i) {
+
+ data = $(this).data();
+ if(data.stickyOffset) {
+ options.offset_top = data.stickyOffset;
+ }
+ if(data.stickyParent) {
+ options.parent = '.' + data.stickyParent;
+ }
+ $(this).stick_in_parent(options);
+
+ });
+
+};
+
+module.exports = StickyKitInit;
{% compress js %}
<script src="{% static "vendors/jquery/dist/jquery.min.js" %}"></script>
<script src="{% static "vendors/overflow.js/js/overflow.js" %}"></script>
+ <script src="{% static "vendors/sticky-kit/jquery.sticky-kit.js" %}"></script>
<script src="{% static "js/index.min.js" %}"></script>
{% block extra_js %}{% endblock %}
{% editable_loader %}
</div>
</div>
- {{ page.basicpage.photo }}<br/>
- {{ page.basicpage.photo_credits }}<br/>
- {{ page.basicpage.photo_alignment }}<br/>
- {{ page.basicpage.photo_description }}<br/>
- {{ page.basicpage.photo_featured }}<br/>
- {{ page.basicpage.photo_featured_credits }}<br/>
{% endblock %}
{% for page in page_branch %}
{% if page.in_menu and page.has_children_in_menu %}
{% if page.is_primary and page.is_current_or_ascendant %}
- <ul class="nav-tree nav-tree--level-{{ branch_level }}">
+ <ul class="nav-tree nav-tree--level-{{ branch_level }}" data-sticky data-sticky-parent="row" data-sticky-offset="100">
<li class="nav-tree__item">
<a class="nav-tree__link{% if page.is_current %} active{% endif %}" href="{{ page.get_absolute_url }}">Accueil</a>
</li>