This commit is contained in:
Yuri Kuznetsov
2014-08-14 13:13:05 +03:00
parent d73cfbca53
commit 7e0034f674
3 changed files with 24 additions and 1 deletions
@@ -115,7 +115,8 @@
"Run Import": "Run Import",
"Duplicate": "Duplicate",
"Notifications": "Notifications",
"Mark all read": "Mark all read"
"Mark all read": "Mark all read",
"See More": "See More"
},
"messages": {
"notModified": "You have not modified the record",
+1
View File
@@ -139,6 +139,7 @@
text = text.replace(self.urlRegex, function (url) {
return '<a href="' + url + '">' + url + '</a>';
});
text = text.replace('[#see-more-text]', ' <a href="javascript:" data-action="seeMoreText">' + self.language.translate('See More')) + '</a>';
return new Handlebars.SafeString(text);
});
+21
View File
@@ -31,10 +31,31 @@ Espo.define('Views.Fields.Text', 'Views.Fields.Base', function (Dep) {
editTemplate: 'fields.text.edit',
detailMaxLength: 400,
seeMoreText: false,
events: {
'click a[data-action="seeMoreText"]': function (e) {
this.seeMoreText = true;
this.render();
}
},
setup: function () {
this.params.rows = this.params.rows || 4;
},
getValueForDisplay: function () {
var text = this.model.get(this.name);
if ((this.mode == 'detail' || this.mode == 'list') && !this.seeMoreText) {
if (text.length > this.detailMaxLength) {
text = text.substr(0, this.detailMaxLength) + ' ...\n[#see-more-text]';
}
}
return text;
},
fetchSearch: function () {
var value = this.$element.val();
if (value) {