diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index bac87753574..858256ff476 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -597,11 +597,6 @@ openerp.mail = function(session) { this.$el.toggle(this.view.get("actual_mode") !== "create"); }, - destroy: function() { - if (this.thread) { this.thread.destroy(); } - this._super.apply(this, arguments); - }, - set_value: function() { var self = this; this._super.apply(this, arguments); @@ -617,13 +612,11 @@ openerp.mail = function(session) { var domain = this.options.domain.concat([['model', '=', this.view.model], ['res_id', '=', this.view.datarecord.id]]); // create and render Thread widget this.$el.find('div.oe_mail_recthread_main').empty(); - if (this.thread) { this.thread.destroy(); } var thread = new mail.Thread(self, { 'context': this.options.context, 'domain': domain, 'message_ids': this.get_value(), // display 'thread_level': this.options.thread_level, 'show_header_compose': true, 'show_delete': true, 'composer': true, }); - this.thread = thread; return thread.appendTo(this.$el.find('div.oe_mail_recthread_main')); }, }); @@ -666,11 +659,6 @@ openerp.mail = function(session) { return (search_view_ready && thread_displayed); }, - destroy: function () { - if (this.thread) this.thread.destroy(); - this._super.apply(this, arguments); - }, - /** * Load the mail.message search view * @param {Object} defaults ?? @@ -716,7 +704,7 @@ openerp.mail = function(session) { message_display: function () { var domain = this.options.domain.concat(this.search_results['domain']); var render_res = session.web.qweb.render('mail.wall_thread_container', {}); - $('
  • ').html(render_res).appendTo(this.$el.find('ul.oe_mail_wall_threads')); + $(render_res).appendTo(this.$el.find('ul.oe_mail_wall_threads')); var thread = new mail.Thread(this, { 'context': this.options.context, 'domain': domain, // display options @@ -725,8 +713,7 @@ openerp.mail = function(session) { 'show_hide': true, 'show_reply_by_email': true, } ); - thread.appendTo(this.$el.find('li.oe_mail_wall_thread:last')); - this.thread = thread; + return thread.appendTo(this.$el.find('li.oe_mail_wall_thread:last')); }, }); }; diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml index c3787f50122..601270cc98f 100644 --- a/addons/mail/static/src/xml/mail.xml +++ b/addons/mail/static/src/xml/mail.xml @@ -39,8 +39,8 @@ wall_thread_container template for the wall Each discussion thread is contained inside this template --> - - +
  • +