From 2bae636948f0cd5c32f73bc2393248ddc8f275b1 Mon Sep 17 00:00:00 2001 From: Deimos Date: Sat, 8 Sep 2018 15:44:10 -0600 Subject: [PATCH] Close sidebar when tapping on "last comment" link --- .../static/js/behaviors/hide-sidebar-no-preventdefault.js | 8 ++++++++ tildes/tildes/templates/topic.jinja2 | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 tildes/static/js/behaviors/hide-sidebar-no-preventdefault.js diff --git a/tildes/static/js/behaviors/hide-sidebar-no-preventdefault.js b/tildes/static/js/behaviors/hide-sidebar-no-preventdefault.js new file mode 100644 index 0000000..775051b --- /dev/null +++ b/tildes/static/js/behaviors/hide-sidebar-no-preventdefault.js @@ -0,0 +1,8 @@ +// Copyright (c) 2018 Tildes contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +$.onmount('[data-js-hide-sidebar-no-preventdefault]', function() { + $(this).on('click', function(event) { + $('#sidebar').removeClass('is-sidebar-displayed'); + }); +}); diff --git a/tildes/tildes/templates/topic.jinja2 b/tildes/tildes/templates/topic.jinja2 index d148ff0..a6562f9 100644 --- a/tildes/tildes/templates/topic.jinja2 +++ b/tildes/tildes/templates/topic.jinja2 @@ -261,7 +261,7 @@
Last comment posted
- + {{ time_ago(topic.last_activity_time) }}