Improve test browser notifications

This commit is contained in:
JonnyWong16 2020-06-01 22:55:59 -07:00
parent 42b17ca495
commit 48203e64a9
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
4 changed files with 14 additions and 14 deletions

View file

@ -296,9 +296,7 @@ ${next.modalIncludes()}
<script src="${http_root}js/ipaddr.min.js"></script>
<script src="${http_root}js/script.js${cache_param}"></script>
<script src="${http_root}js/jquery.tripleclick.min.js"></script>
% if _session['user_group'] == 'admin' and BROWSER_NOTIFIERS:
<script src="${http_root}js/ajaxNotifications.js"></script>
% endif
<script>
% if _session['user_group'] == 'admin':
$('body').on('click', '#updateDismiss', function() {
@ -423,6 +421,10 @@ ${next.modalIncludes()}
$(document).on('hidden.bs.modal', '.modal', function () {
$('.modal:visible').length && $(document.body).addClass('modal-open');
});
% if _session['user_group'] == 'admin' and BROWSER_NOTIFIERS:
check_notifications();
% endif
});
% if _session['user_group'] != 'admin':

View file

@ -36,7 +36,3 @@ function check_notifications() {
check_notifications();
}, 5000);
}
$(document).ready(function () {
check_notifications();
});

View file

@ -853,10 +853,7 @@
PNotify.prototype.options.hide = true;
PNotify.prototype.options.delay = $('#browser_auto_hide_delay').val() * 1000;
}
var notification = new PNotify({
title: $('#test_subject').val(),
text: $('#test_body').val()
});
displayPNotify($('#test_subject').val(), $('#test_body').val());
showMsg('<i class="fa fa-check"></i> Notification sent.', false, true, 5000);
}
}