diff options
author | tim-zh <tim.zhlobich@gmail.com> | 2017-05-01 18:55:33 +0300 |
---|---|---|
committer | tim-zh <tim.zhlobich@gmail.com> | 2017-05-01 18:55:33 +0300 |
commit | ae4b7b1ef5ec86f8ac5859d6e3593ba49885f036 (patch) | |
tree | 82c2a55aa43e4334e514d15b95b8136ce33928c7 /tools/gui/resources/web/definitions.js | |
parent | fb0c68ffab35db304771e177ce93f80a680fabcc (diff) | |
download | cbt-ae4b7b1ef5ec86f8ac5859d6e3593ba49885f036.tar.gz cbt-ae4b7b1ef5ec86f8ac5859d6e3593ba49885f036.tar.bz2 cbt-ae4b7b1ef5ec86f8ac5859d6e3593ba49885f036.zip |
Fix #421 Html notifications
Diffstat (limited to 'tools/gui/resources/web/definitions.js')
-rw-r--r-- | tools/gui/resources/web/definitions.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/gui/resources/web/definitions.js b/tools/gui/resources/web/definitions.js index 75ef509..846bbc9 100644 --- a/tools/gui/resources/web/definitions.js +++ b/tools/gui/resources/web/definitions.js @@ -53,12 +53,15 @@ let Popup = { }; let Notifications = { - init: function () { - Notification.requestPermission(); + init: function (container) { + this._container = container; }, show: function (text, title) { - new Notification(title || "", {body: text}); + let now = new Date(); + this._container.html(this._container.html() + now.getHours() + ":" + now.getMinutes() + ":" + now.getSeconds() + + " <b>" + (title || "") + "</b><br>" + text + "<br><br>"); + this._container.animate({scrollTop: this._container[0].scrollHeight}, {duration: 500, queue: false}); }, showFail: function (e) { |