aboutsummaryrefslogtreecommitdiffstats
path: root/view/tpl
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-01-19 12:24:03 +0100
committerMario Vavti <mario@mariovavti.com>2018-01-19 12:24:03 +0100
commit40a8e504711f008dd88310b7f1add46f8c881fe8 (patch)
tree35043f43f6bac6f6b9a4e3bb62518ac03b13217f /view/tpl
parent66e1e5b1b68e6e1d41b0ec5c5ae88851b141edd6 (diff)
downloadvolse-hubzilla-40a8e504711f008dd88310b7f1add46f8c881fe8.tar.gz
volse-hubzilla-40a8e504711f008dd88310b7f1add46f8c881fe8.tar.bz2
volse-hubzilla-40a8e504711f008dd88310b7f1add46f8c881fe8.zip
only show clear button if there is something to clear
Diffstat (limited to 'view/tpl')
-rw-r--r--view/tpl/notifications_widget.tpl11
1 files changed, 8 insertions, 3 deletions
diff --git a/view/tpl/notifications_widget.tpl b/view/tpl/notifications_widget.tpl
index 030d1eef9..7ce032069 100644
--- a/view/tpl/notifications_widget.tpl
+++ b/view/tpl/notifications_widget.tpl
@@ -69,14 +69,19 @@
$('#cn-{{$notification.type}}-input').val('');
$('#cn-{{$notification.type}}-only').removeClass('active sticky-top');
$("#nav-{{$notification.type}}-menu .notification").removeClass('d-none');
+ $('#cn-{{$notification.type}}-input-clear').addClass('d-none');
});
$(document).on('keyup', '#cn-{{$notification.type}}-input', function(e) {
var val = $('#cn-{{$notification.type}}-input').val().toLowerCase();
- if(val)
+ if(val) {
$('#cn-{{$notification.type}}-only').addClass('active sticky-top');
- else
+ $('#cn-{{$notification.type}}-input-clear').removeClass('d-none');
+ }
+ else {
$('#cn-{{$notification.type}}-only').removeClass('active sticky-top');
+ $('#cn-{{$notification.type}}-input-clear').addClass('d-none');
+ }
$("#nav-{{$notification.type}}-menu .notification").each(function(i, el){
var cn = $(el).data('contact_name').toLowerCase();
@@ -141,7 +146,7 @@
</div>
<div class="list-group-item clearfix notifications-textinput" id="cn-{{$notification.type}}-only">
<input id="cn-{{$notification.type}}-input" type="text" class="form-control form-control-sm" placeholder="&#xf0b0; Filter by name">
- <div id="cn-{{$notification.type}}-input-clear" class="text-muted notifications-textinput-clear"><i class="fa fa-remove"></i></div>
+ <div id="cn-{{$notification.type}}-input-clear" class="text-muted notifications-textinput-clear d-none"><i class="fa fa-remove"></i></div>
</div>
{{/if}}
<div id="nav-{{$notification.type}}-menu" class="" rel="{{$notification.type}}">