From f48f10bcfa41c03439db4ee91d26be4d39772903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Mon, 27 Feb 2012 17:14:09 +0100 Subject: [PATCH] [REF] Cleaned a bit truncated message code bzr revid: tde@openerp.com-20120227161409-ej67dg04cy2deyjg --- addons/mail/static/src/css/mail.css | 3 ++- addons/mail/static/src/js/mail.js | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/mail/static/src/css/mail.css b/addons/mail/static/src/css/mail.css index be02336da41..653f71fc040 100644 --- a/addons/mail/static/src/css/mail.css +++ b/addons/mail/static/src/css/mail.css @@ -151,7 +151,8 @@ border-bottom: 1px solid #D2D9E7; } -.oe_mail_msg_body { +.oe_mail_msg_body a.reduce, .oe_mail_msg_body_short a.expand { + color: #4E43E7; } .oe_mail_msg_author { diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 1879a117c1f..3d7bca72190 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -95,16 +95,17 @@ openerp.mail = function(session) { record.tr_body_text = self.truncate_string(record.body_text, self.params.char_show_more); record.body_text = self.do_replace_internal_links(record.body_text); if (record.tr_body_text) record.tr_body_text = self.do_replace_internal_links(record.tr_body_text); + // render $(session.web.qweb.render('ThreadMsg', {'record': record})).appendTo(self.$element.find('div.oe_mail_thread_display')); // truncated: hide full-text, show summary, add buttons if (record.tr_body_text) { - var node = self.$element.find('span.oe_mail_msg_body:last').append('Show less'); + var node = self.$element.find('span.oe_mail_msg_body:last').append(' [ ... Show less]'); + self.$element.find('p.oe_mail_msg_p:last').append($('' + record.tr_body_text + ' [ ... Show more]')); + var new_node = self.$element.find('span.oe_mail_msg_body_short:last'); node.hide(); node.find('a:last').click(function() { node.hide(); new_node.show(); return false; }); - self.$element.find('p.oe_mail_msg_p:last').append($('' + record.tr_body_text + 'Show more')); - var new_node = self.$element.find('span.oe_mail_msg_body_short:last'); new_node.find('a:last').click(function() { new_node.hide(); node.show(); return false; });