mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-03 09:49:30 +02:00
Overlay notifications updated.
This commit is contained in:
parent
ab0600151e
commit
5ff1ca45f8
7 changed files with 78 additions and 27 deletions
|
@ -19,7 +19,9 @@
|
|||
//
|
||||
$(document).ready(function () {
|
||||
initTabs();
|
||||
$(document).mousemove(mouse_message_move);
|
||||
$('#notification').click(function() {
|
||||
clearNotification();
|
||||
});
|
||||
});
|
||||
|
||||
function initTabs()
|
||||
|
@ -86,23 +88,25 @@ function toggleVisible(element) {
|
|||
}
|
||||
}
|
||||
|
||||
var mouseTimeout = null;
|
||||
function mouseMessage(message, timeout) {
|
||||
if (mouseTimeout != null) {
|
||||
clearTimeout(mouseTimeout);
|
||||
mouseTimeout = null;
|
||||
var notificationTimeout = null;
|
||||
function displayNotification(message, timeout) {
|
||||
if (notificationTimeout != null || !message) {
|
||||
clearNotification();
|
||||
}
|
||||
$('#mouse_message').html(message);
|
||||
$('#mouse_message').fadeIn();
|
||||
mouseTimeout = setTimeout(function() {
|
||||
$('#mouse_message').fadeOut();
|
||||
}, timeout);
|
||||
|
||||
if (message) {
|
||||
$('#notification-content').html(message);
|
||||
$('#notification').removeClass('notification-out');
|
||||
notificationTimeout = setTimeout(function() {
|
||||
clearNotification();
|
||||
}, timeout);
|
||||
}
|
||||
}
|
||||
|
||||
function mouse_message_move(e) {
|
||||
$('#mouse_message').css({top: e.clientY + 10,
|
||||
left: e.clientX + 10
|
||||
});
|
||||
function clearNotification() {
|
||||
clearTimeout(notificationTimeout);
|
||||
notificationTimeout = null;
|
||||
$('#notification').addClass("notification-out");
|
||||
}
|
||||
|
||||
// delayRun
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue