summaryrefslogtreecommitdiff
path: root/addons/mail/static/src
diff options
context:
space:
mode:
Diffstat (limited to 'addons/mail/static/src')
-rw-r--r--addons/mail/static/src/js/client_action.js4
-rw-r--r--addons/mail/static/src/js/systray.js5
2 files changed, 7 insertions, 2 deletions
diff --git a/addons/mail/static/src/js/client_action.js b/addons/mail/static/src/js/client_action.js
index fc9d73fbfb7..e06abc5a9de 100644
--- a/addons/mail/static/src/js/client_action.js
+++ b/addons/mail/static/src/js/client_action.js
@@ -120,7 +120,9 @@ var ChatAction = Widget.extend(ControlPanelMixin, {
},
on_attach_callback: function () {
- this.thread.scroll_to({offset: this.channels_scrolltop[this.channel.id]});
+ if (this.channel) {
+ this.thread.scroll_to({offset: this.channels_scrolltop[this.channel.id]});
+ }
},
on_detach_callback: function () {
this.channels_scrolltop[this.channel.id] = this.thread.get_scrolltop();
diff --git a/addons/mail/static/src/js/systray.js b/addons/mail/static/src/js/systray.js
index c5d34f179bc..19e225c364f 100644
--- a/addons/mail/static/src/js/systray.js
+++ b/addons/mail/static/src/js/systray.js
@@ -29,11 +29,14 @@ var NotificationTopButton = Widget.extend({
},
on_click: function (event) {
event.preventDefault();
+ this.discuss_redirect();
+ },
+ discuss_redirect: _.debounce(function () {
var discuss_ids = chat_manager.get_discuss_ids();
this.do_action(discuss_ids.action_id, {clear_breadcrumbs: true}).then(function () {
core.bus.trigger('change_menu_section', discuss_ids.menu_id);
});
- },
+ }, 1000, true),
});
SystrayMenu.Items.push(NotificationTopButton);