Browse Source

Close sidebar when tapping on "last comment" link

merge-requests/37/head
Deimos 6 years ago
parent
commit
2bae636948
  1. 8
      tildes/static/js/behaviors/hide-sidebar-no-preventdefault.js
  2. 2
      tildes/tildes/templates/topic.jinja2

8
tildes/static/js/behaviors/hide-sidebar-no-preventdefault.js

@ -0,0 +1,8 @@
// Copyright (c) 2018 Tildes contributors <code@tildes.net>
// 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');
});
});

2
tildes/tildes/templates/topic.jinja2

@ -261,7 +261,7 @@
<dt>Last comment posted</dt> <dt>Last comment posted</dt>
<dd> <dd>
<a href="{{ comments.most_recent_comment.permalink }}">
<a href="{{ comments.most_recent_comment.permalink }}" data-js-hide-sidebar-no-preventdefault>
{{ time_ago(topic.last_activity_time) }} {{ time_ago(topic.last_activity_time) }}
</a> </a>
</dd> </dd>

Loading…
Cancel
Save