diff options
| author | rr- | 2016-09-26 22:44:32 +0200 |
|---|---|---|
| committer | rr- | 2016-09-26 22:48:13 +0200 |
| commit | d31acc5952c0645110e334dbe032d7700e5af8a4 (patch) | |
| tree | 2e1de395a10637e219c4fd32d6e8ea88112a95e8 /client | |
| parent | 560a7d68398b027a0ad773b9b21f22ae3e81130b (diff) | |
client/views: show "!" in document title on errors
Closes #96
Diffstat (limited to 'client')
| -rw-r--r-- | client/js/models/top_navigation.js | 1 | ||||
| -rw-r--r-- | client/js/util/views.js | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/client/js/models/top_navigation.js b/client/js/models/top_navigation.js index 5b93d99..ebb3753 100644 --- a/client/js/models/top_navigation.js +++ b/client/js/models/top_navigation.js @@ -53,6 +53,7 @@ class TopNavigation extends events.EventTarget { } setTitle(title) { + document.oldTitle = null; document.title = config.name + (title ? (' – ' + title) : ''); } diff --git a/client/js/util/views.js b/client/js/util/views.js index 0d3f71f..31c19dd 100644 --- a/client/js/util/views.js +++ b/client/js/util/views.js @@ -288,6 +288,8 @@ function showMessage(target, message, className) { } function showError(target, message) { + document.oldTitle = document.title; + document.title = `! ${document.title}`; return showMessage(target, misc.formatInlineMarkdown(message), 'error'); } @@ -300,6 +302,10 @@ function showInfo(target, message) { } function clearMessages(target) { + if (document.oldTitle) { + document.title = document.oldTitle; + document.oldTitle = null; + } const messagesHolder = target.querySelector('.messages'); /* TODO: animate that */ emptyContent(messagesHolder); |