diff options
Diffstat (limited to 'apps/system/js/system_banner.js')
-rw-r--r-- | apps/system/js/system_banner.js | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/apps/system/js/system_banner.js b/apps/system/js/system_banner.js deleted file mode 100644 index 89028e2..0000000 --- a/apps/system/js/system_banner.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -var SystemBanner = { - banner: document.getElementById('system-banner'), - - // Shows a banner with a given message. - // Optionally shows a button with a given label/callback. - // buttonParams = { label: ..., callback: ... } - show: function sb_show(message, buttonParams) { - var banner = this.banner; - banner.firstElementChild.textContent = message; - - var button = banner.querySelector('button'); - if (buttonParams) { - banner.dataset.button = true; - button.textContent = buttonParams.label; - button.addEventListener('click', buttonParams.callback); - } - - banner.addEventListener('animationend', function animationend() { - banner.removeEventListener('animationend', animationend); - banner.classList.remove('visible'); - - if (buttonParams) { - banner.dataset.button = false; - button.removeEventListener('click', buttonParams.callback); - button.classList.remove('visible'); - } - }); - - banner.classList.add('visible'); - } -}; |