[REF] Cleaned a bit truncated message code

bzr revid: tde@openerp.com-20120227161409-ej67dg04cy2deyjg
This commit is contained in:
Thibault Delavallée
2012-02-27 17:14:09 +01:00
parent 32669277bc
commit f48f10bcfa
2 changed files with 6 additions and 4 deletions
+2 -1
View File
@@ -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 {
+4 -3
View File
@@ -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('<a href="#">Show less</a>');
var node = self.$element.find('span.oe_mail_msg_body:last').append(' <a href="#" class="reduce">[ ... Show less]</a>');
self.$element.find('p.oe_mail_msg_p:last').append($('<span class="oe_mail_msg_body_short">' + record.tr_body_text + ' <a href="#" class="expand">[ ... Show more]</a></span>'));
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($('<span class="oe_mail_msg_body_short">' + record.tr_body_text + '<a href="#">Show more</a></span>'));
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;
});