aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-05-03 12:31:10 +0000
committerMario <mario@mariovavti.com>2020-05-03 12:31:10 +0000
commitfd48f9d173a7a76f9ecaedf078272f5fd3bdd706 (patch)
treea71c06a78aae6988dbdcac3bc99133c92f083416 /view
parent104c45f6e6550f723f976bd071bb0bd8e9aafce9 (diff)
downloadvolse-hubzilla-fd48f9d173a7a76f9ecaedf078272f5fd3bdd706.tar.gz
volse-hubzilla-fd48f9d173a7a76f9ecaedf078272f5fd3bdd706.tar.bz2
volse-hubzilla-fd48f9d173a7a76f9ecaedf078272f5fd3bdd706.zip
improve functionality of combined notification filters
Diffstat (limited to 'view')
-rw-r--r--view/css/widgets.css5
-rw-r--r--view/js/main.js6
-rw-r--r--view/tpl/notifications_widget.tpl18
3 files changed, 20 insertions, 9 deletions
diff --git a/view/css/widgets.css b/view/css/widgets.css
index ca7267189..30e7e6972 100644
--- a/view/css/widgets.css
+++ b/view/css/widgets.css
@@ -225,6 +225,11 @@ a.wikilist {
margin-bottom: 1rem;
}
+.tt-filter-active,
+.cn-filter-active {
+ display: none !important;
+}
+
/* contact block */
.contact-block-div .oneway-overlay {
font-size: 20px;
diff --git a/view/js/main.js b/view/js/main.js
index 5ba4282a6..49c0bed97 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -1807,7 +1807,7 @@ function sse_handleNotificationsItems(notifyType, data, replace, followup) {
$("#nav-" + notifyType + "-menu .notifications-autotime").timeago();
if($('#tt-' + notifyType + '-only').hasClass('active'))
- $('#nav-' + notifyType + '-menu [data-thread_top=false]').addClass('d-none');
+ $('#nav-' + notifyType + '-menu [data-thread_top=false]').addClass('tt-filter-active');
if($('#cn-' + notifyType + '-input').length) {
var filter = $('#cn-' + notifyType + '-input').val().toString().toLowerCase();
@@ -1818,9 +1818,9 @@ function sse_handleNotificationsItems(notifyType, data, replace, followup) {
var cn = $(el).data('contact_name').toString().toLowerCase();
var ca = $(el).data('contact_addr').toString().toLowerCase();
if(cn.indexOf(filter) === -1 && ca.indexOf(filter) === -1)
- $(el).addClass('d-none');
+ $(el).addClass('cn-filter-active');
else
- $(el).removeClass('d-none');
+ $(el).removeClass('cn-filter-active');
});
}
}
diff --git a/view/tpl/notifications_widget.tpl b/view/tpl/notifications_widget.tpl
index 146c510f1..001a202af 100644
--- a/view/tpl/notifications_widget.tpl
+++ b/view/tpl/notifications_widget.tpl
@@ -81,14 +81,20 @@
{{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]').toggleClass('d-none');
- $(this).toggleClass('active sticky-top');
+ if($(this).hasClass('active sticky-top')) {
+ $('#nav-{{$notification.type}}-menu .notification[data-thread_top=false]').removeClass('tt-filter-active');
+ $(this).removeClass('active sticky-top');
+ }
+ else {
+ $('#nav-{{$notification.type}}-menu .notification[data-thread_top=false]').addClass('tt-filter-active');
+ $(this).addClass('active sticky-top');
+ }
+
});
$(document).on('click', '#cn-{{$notification.type}}-input-clear', function(e) {
$('#cn-{{$notification.type}}-input').val('');
$('#cn-{{$notification.type}}-only').removeClass('active sticky-top');
- $("#nav-{{$notification.type}}-menu .notification").removeClass('d-none');
+ $("#nav-{{$notification.type}}-menu .notification").removeClass('cn-filter-active');
$('#cn-{{$notification.type}}-input-clear').addClass('d-none');
});
$(document).on('input', '#cn-{{$notification.type}}-input', function(e) {
@@ -108,9 +114,9 @@
var ca = $(el).data('contact_addr').toString().toLowerCase();
if(cn.indexOf(val) === -1 && ca.indexOf(val) === -1)
- $(this).addClass('d-none');
+ $(this).addClass('cn-filter-active');
else
- $(this).removeClass('d-none');
+ $(this).removeClass('cn-filter-active');
});
});
{{/if}}