From 30d0809f5b014be63cdec5aaae0fe5a0b2fb4677 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sun, 12 Oct 2014 20:02:18 -0500 Subject: [PATCH] Show a message if no posts exist with the given tags. --- index.html | 1 + static/main.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/index.html b/index.html index 171db00..86505d3 100644 --- a/index.html +++ b/index.html @@ -118,6 +118,7 @@ title: Home {% for post in site.posts %}
  • {{ post.date | date: "%b %-d, %Y" }}: {{ post.title }}
    {{ post.description }}
    {{ post.tags | join: ", " }} ·
  • {% endfor %} + diff --git a/static/main.js b/static/main.js index 159d738..a36a932 100644 --- a/static/main.js +++ b/static/main.js @@ -11,6 +11,7 @@ function load_tag_filters() { filter.push($(this).data("tag")) }); $("#post-list li").show(); + $("#null-post").hide(); if ($(".tag-selected").length == 0) return; $("#post-list li").each(function() { @@ -22,6 +23,8 @@ function load_tag_filters() { } } }); + if ($("#post-list li:not(:hidden)").length == 0) + $("#null-post").show(); } if (window.location.hash) {