diff --git a/application/Espo/Resources/i18n/en_US/Global.json b/application/Espo/Resources/i18n/en_US/Global.json
index 4894bf19c6..dffb524c24 100644
--- a/application/Espo/Resources/i18n/en_US/Global.json
+++ b/application/Espo/Resources/i18n/en_US/Global.json
@@ -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",
diff --git a/frontend/client/src/view-helper.js b/frontend/client/src/view-helper.js
index d01b3bcaae..f0af70e63f 100644
--- a/frontend/client/src/view-helper.js
+++ b/frontend/client/src/view-helper.js
@@ -139,6 +139,7 @@
text = text.replace(self.urlRegex, function (url) {
return '' + url + '';
});
+ text = text.replace('[#see-more-text]', ' ' + self.language.translate('See More')) + '';
return new Handlebars.SafeString(text);
});
diff --git a/frontend/client/src/views/fields/text.js b/frontend/client/src/views/fields/text.js
index 3d0918e6e0..6976b808fa 100644
--- a/frontend/client/src/views/fields/text.js
+++ b/frontend/client/src/views/fields/text.js
@@ -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) {