only show clear button if there is something to clear
This commit is contained in:
parent
66e1e5b1b6
commit
40a8e50471
@ -69,14 +69,19 @@
|
|||||||
$('#cn-{{$notification.type}}-input').val('');
|
$('#cn-{{$notification.type}}-input').val('');
|
||||||
$('#cn-{{$notification.type}}-only').removeClass('active sticky-top');
|
$('#cn-{{$notification.type}}-only').removeClass('active sticky-top');
|
||||||
$("#nav-{{$notification.type}}-menu .notification").removeClass('d-none');
|
$("#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) {
|
$(document).on('keyup', '#cn-{{$notification.type}}-input', function(e) {
|
||||||
var val = $('#cn-{{$notification.type}}-input').val().toLowerCase();
|
var val = $('#cn-{{$notification.type}}-input').val().toLowerCase();
|
||||||
|
|
||||||
if(val)
|
if(val) {
|
||||||
$('#cn-{{$notification.type}}-only').addClass('active sticky-top');
|
$('#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}}-only').removeClass('active sticky-top');
|
||||||
|
$('#cn-{{$notification.type}}-input-clear').addClass('d-none');
|
||||||
|
}
|
||||||
|
|
||||||
$("#nav-{{$notification.type}}-menu .notification").each(function(i, el){
|
$("#nav-{{$notification.type}}-menu .notification").each(function(i, el){
|
||||||
var cn = $(el).data('contact_name').toLowerCase();
|
var cn = $(el).data('contact_name').toLowerCase();
|
||||||
@ -141,7 +146,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="list-group-item clearfix 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=" Filter by name">
|
<input id="cn-{{$notification.type}}-input" type="text" class="form-control form-control-sm" placeholder=" 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>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<div id="nav-{{$notification.type}}-menu" class="" rel="{{$notification.type}}">
|
<div id="nav-{{$notification.type}}-menu" class="" rel="{{$notification.type}}">
|
||||||
|
Reference in New Issue
Block a user