From dcad9ce26a0de72ba3ad5b86ddb62298598ac380 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 1 Dec 2017 21:00:39 +0100 Subject: add a filter for notification to show new posts only --- view/tpl/notifications_widget.tpl | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'view/tpl') diff --git a/view/tpl/notifications_widget.tpl b/view/tpl/notifications_widget.tpl index 18f3ef12d..90f03faf0 100644 --- a/view/tpl/notifications_widget.tpl +++ b/view/tpl/notifications_widget.tpl @@ -22,7 +22,7 @@ }); {{if $module == 'display' || $module == 'hq'}} - $(document).on('click touch', '.notification', function(e) { + $(document).on('click', '.notification', function(e) { var b64mid = $(this).data('b64mid'); var notify_id = $(this).data('notify_id'); var path = $(this)[0].pathname.substr(1,7); @@ -53,6 +53,16 @@ }); {{/if}} + {{foreach $notifications as $notification}} + {{if $notification.filter}} + $(document).on('click', '#tt-{{$notification.type}}-only', function(e) { + e.preventDefault(); + $('#nav-{{$notification.type}}-menu [data-thread_top=false]').toggle(); + $(this).toggleClass('active'); + }); + {{/if}} + {{/foreach}} + function getData(b64mid, notify_id) { $('.thread-wrapper').remove(); bParam_mid = b64mid; @@ -72,7 +82,7 @@