aboutsummaryrefslogtreecommitdiffstats
path: root/view/tpl/notifications_widget.tpl
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-01-21 17:08:39 -0800
committerzotlabs <mike@macgirvin.com>2018-01-21 17:08:39 -0800
commitd4c81d8e0e4cea191009da66c1a4374e6537fc61 (patch)
treec962a68dbf7874e326f4ca268fe0183ac184ea12 /view/tpl/notifications_widget.tpl
parent89aa882c95b4d01bd7bf6ff461c1dcefdedea7bd (diff)
parent1709dbd376af3171815f25b7055fb41da53924cb (diff)
downloadvolse-hubzilla-d4c81d8e0e4cea191009da66c1a4374e6537fc61.tar.gz
volse-hubzilla-d4c81d8e0e4cea191009da66c1a4374e6537fc61.tar.bz2
volse-hubzilla-d4c81d8e0e4cea191009da66c1a4374e6537fc61.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
Diffstat (limited to 'view/tpl/notifications_widget.tpl')
-rw-r--r--view/tpl/notifications_widget.tpl23
1 files changed, 17 insertions, 6 deletions
diff --git a/view/tpl/notifications_widget.tpl b/view/tpl/notifications_widget.tpl
index 9489e850c..6b3f4b15b 100644
--- a/view/tpl/notifications_widget.tpl
+++ b/view/tpl/notifications_widget.tpl
@@ -65,16 +65,26 @@
$('#nav-{{$notification.type}}-menu [data-thread_top=false]').toggle();
$(this).toggleClass('active sticky-top');
});
- $(document).on('keyup', '#cn-{{$notification.type}}-input', function(e) {
- var val = $('#cn-{{$notification.type}}-input').val().toLowerCase();
+ $(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');
+ $('#cn-{{$notification.type}}-input-clear').addClass('d-none');
+ });
+ $(document).on('input', '#cn-{{$notification.type}}-input', function(e) {
+ var val = $('#cn-{{$notification.type}}-input').val().toString().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();
+ var cn = $(el).data('contact_name').toString().toLowerCase();
if(cn.indexOf(val) === -1)
$(this).addClass('d-none');
@@ -134,8 +144,9 @@
<div class="list-group-item cursor-pointer" id="tt-{{$notification.type}}-only">
<i class="fa fa-fw fa-filter"></i> {{$notification.filter.label}}
</div>
- <div class="list-group-item notifications-textinput" id="cn-{{$notification.type}}-only">
+ <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 d-none"><i class="fa fa-times"></i></div>
</div>
{{/if}}
<div id="nav-{{$notification.type}}-menu" class="" rel="{{$notification.type}}">