This commit is contained in:
2021-05-13 23:35:10 +00:00
parent 1cf4f90fd6
commit 881564f1b8
5 changed files with 38 additions and 10 deletions

View File

@@ -339,6 +339,23 @@ export default {
);
},
///////////////////////////////
// Truncate a string
//truncates and adds ellipses
//
// @param {String} source string
// @param {number} length desired
// @return {string} A new string truncated with ellipses at end
truncateString: function(s, len) {
if (this.stringIsNullOrEmpty(s)) {
return s;
}
if (s.length > len) {
return s.substring(0, len) + "...";
} else {
return s;
}
},
///////////////////////////////
// Format tags for display
//
//