From dd27026618ab200253ab6fcd6e58e247f8cc6711 Mon Sep 17 00:00:00 2001 From: 8chan Date: Fri, 6 Mar 2015 02:01:53 -0800 Subject: [PATCH] Show stickies at top of catalog --- js/catalog.js | 4 ++-- templates/themes/catalog/catalog.html | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/js/catalog.js b/js/catalog.js index 38382096..18da6d6b 100644 --- a/js/catalog.js +++ b/js/catalog.js @@ -28,7 +28,7 @@ if (active_page == 'catalog') $(function(){ $("#sort_by").change(function(){ var value = this.value; - $('#Grid').mixItUp('sort', value); + $('#Grid').mixItUp('sort', (value == "random" ? value : "sticky:desc " + value)); catalog.sort_by = value; localStorage.catalog = JSON.stringify(catalog); }); @@ -46,7 +46,7 @@ if (active_page == 'catalog') $(function(){ $('#Grid').mixItUp({ animation: { enable: false - }, + } }); if (catalog.sort_by !== undefined) { diff --git a/templates/themes/catalog/catalog.html b/templates/themes/catalog/catalog.html index 2ca66089..1011fdaf 100644 --- a/templates/themes/catalog/catalog.html +++ b/templates/themes/catalog/catalog.html @@ -38,6 +38,8 @@ data-bump="{{ post.bump }}" data-time="{{ post.time }}" data-id="{{ post.id }}" + data-sticky="{% if post.sticky %}true{% else %}false{% endif %}" + data-locked="{% if post.locked %}true{% else %}false{% endif %}" >
@@ -49,7 +51,7 @@ id="img-{{ post.id }}" data-subject="{% if post.subject %}{{ post.subject|e }}{% endif %}" data-name="{{ post.name|e }}" data-muhdifference="{{ post.muhdifference }}" class="{{post.board}} thread-image" title="{{post.bump|date('%b %d %H:%M')}}">
- R: {{ post.reply_count }} / I: {{ post.image_count }} + R: {{ post.reply_count }} / I: {{ post.image_count }}{% if post.sticky %} (sticky){% endif %} {% if post.subject %}