summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js
diff options
context:
space:
mode:
authorGéry Debongnie <ged@odoo.com>2015-11-10 10:04:02 +0100
committerGéry Debongnie <ged@odoo.com>2015-11-12 08:51:56 +0100
commitbac5a1945171c4d1ed5eed21c64b14624be24ae3 (patch)
tree01ed8241ddf643bb63937c60ba0a8a8f6bc32a69 /addons/mail/static/src/js
parent5264ccf0d0ebbfc6600ba5d3c0efc16bbe05c4d4 (diff)
[FIX] mail: various small UI tweaks/fixes
- put the mentionned partners and the attachment above the composer instead of below - debounce some links in thread.js to prevent double loading views when double-clicking - readd the # in front of the channelname of the title of the client action - give the channel_id to the thread in a chat window, so it does not display the channel name everytime it displays a message - correctly close dm chat window when the dm channel is closed in the main sidebar - simplify the help messages when a channel is empty
Diffstat (limited to 'addons/mail/static/src/js')
-rw-r--r--addons/mail/static/src/js/chat_window.js1
-rw-r--r--addons/mail/static/src/js/client_action.js4
-rw-r--r--addons/mail/static/src/js/thread.js12
3 files changed, 13 insertions, 4 deletions
diff --git a/addons/mail/static/src/js/chat_window.js b/addons/mail/static/src/js/chat_window.js
index 86fefa8429c..cfc3c8c5447 100644
--- a/addons/mail/static/src/js/chat_window.js
+++ b/addons/mail/static/src/js/chat_window.js
@@ -32,6 +32,7 @@ return Widget.extend({
this.$input = this.$('.o_chat_input input');
this.thread = new ChatThread(this, {
+ channel_id: this.channel_id,
display_avatar: false,
display_needactions: false,
display_stars: this.options.display_stars,
diff --git a/addons/mail/static/src/js/client_action.js b/addons/mail/static/src/js/client_action.js
index 7974203abe4..2bbbdfb4355 100644
--- a/addons/mail/static/src/js/client_action.js
+++ b/addons/mail/static/src/js/client_action.js
@@ -166,7 +166,7 @@ var ChatAction = Widget.extend(ControlPanelMixin, {
},
});
this.thread = new ChatThread(this, {
- no_content_helper: this.action.help,
+ display_help: true
});
this.$buttons = $(QWeb.render("mail.chat.ControlButtons", {}));
@@ -344,7 +344,7 @@ var ChatAction = Widget.extend(ControlPanelMixin, {
}
// Update control panel
- self.set("title", channel.name);
+ self.set("title", '#' + channel.name);
// Hide 'detach' button in static channels
self.$buttons
.find('.o_mail_chat_button_detach')
diff --git a/addons/mail/static/src/js/thread.js b/addons/mail/static/src/js/thread.js
index 60fa5fd63f5..539b43740a3 100644
--- a/addons/mail/static/src/js/thread.js
+++ b/addons/mail/static/src/js/thread.js
@@ -82,15 +82,23 @@ var Thread = Widget.extend({
event.preventDefault();
var res_id = $(event.target).data('oe-id');
var res_model = $(event.target).data('oe-model');
- this.trigger('redirect', res_model, res_id);
+ this._redirect({model:res_model, id: res_id});
},
on_channel_redirect: function (event) {
event.preventDefault();
var channel_id = $(event.target).data('oe-id');
- this.trigger('redirect_to_channel', channel_id);
+ this._redirect({channel_id: channel_id});
},
+ _redirect: _.debounce(function (options) {
+ if ('channel_id' in options) {
+ this.trigger('redirect_to_channel', options.channel_id);
+ } else {
+ this.trigger('redirect', options.model, options.id);
+ }
+ }, 200, true),
+
on_click_show_more: function () {
this.trigger('load_more_messages');
},