mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
refactor
This commit is contained in:
parent
5ebf50595e
commit
d7bc16209d
@ -228,31 +228,6 @@ function inventreeDocReady() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The notification checker is initiated when the doc is loaded. It checks if there are unread notifications
|
|
||||||
* if unread messages exist the alert flag is raised by making it visible
|
|
||||||
**/
|
|
||||||
function notificationCheck() {
|
|
||||||
// only refresh state if in focus
|
|
||||||
if (document.hasFocus()) {
|
|
||||||
inventreeGet(
|
|
||||||
'/api/notifications/',
|
|
||||||
{
|
|
||||||
read: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
success: function(response) {
|
|
||||||
if (response.length == 0) {
|
|
||||||
$("#notification-alert").addClass("d-none");
|
|
||||||
} else {
|
|
||||||
$("#notification-alert").removeClass("d-none");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function isFileTransfer(transfer) {
|
function isFileTransfer(transfer) {
|
||||||
/* Determine if a transfer (e.g. drag-and-drop) is a file transfer
|
/* Determine if a transfer (e.g. drag-and-drop) is a file transfer
|
||||||
*/
|
*/
|
||||||
|
@ -118,3 +118,29 @@ function showMessage(message, options={}) {
|
|||||||
$(this).alert(close);
|
$(this).alert(close);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The notification checker is initiated when the document is loaded. It checks if there are unread notifications
|
||||||
|
* if unread messages exist the alert flag is raised by making it visible
|
||||||
|
**/
|
||||||
|
function notificationCheck() {
|
||||||
|
// only refresh state if in focus
|
||||||
|
if (document.hasFocus()) {
|
||||||
|
inventreeGet(
|
||||||
|
'/api/notifications/',
|
||||||
|
{
|
||||||
|
read: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
success: function(response) {
|
||||||
|
if (response.length == 0) {
|
||||||
|
$("#notification-alert").addClass("d-none");
|
||||||
|
} else {
|
||||||
|
$("#notification-alert").removeClass("d-none");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user