see more
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user