diff --git a/InvenTree/InvenTree/static/script/inventree/inventree.js b/InvenTree/InvenTree/static/script/inventree/inventree.js index 3672d2a38c..8bbb2aa918 100644 --- a/InvenTree/InvenTree/static/script/inventree/inventree.js +++ b/InvenTree/InvenTree/static/script/inventree/inventree.js @@ -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) { /* Determine if a transfer (e.g. drag-and-drop) is a file transfer */ diff --git a/InvenTree/InvenTree/static/script/inventree/notification.js b/InvenTree/InvenTree/static/script/inventree/notification.js index f6bdf3bc57..6c8ab623ac 100644 --- a/InvenTree/InvenTree/static/script/inventree/notification.js +++ b/InvenTree/InvenTree/static/script/inventree/notification.js @@ -118,3 +118,29 @@ function showMessage(message, options={}) { $(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"); + } + } + } + ); + } +} \ No newline at end of file