Update app.js
parent
c1a0f0f379
commit
fa4a568fe9
|
|
@ -10,15 +10,15 @@ Graphics.prototype.setFontBold = function(scale) {
|
||||||
// we also define functions using 'let fn = function() {..}' for the same reason. function decls are global
|
// we also define functions using 'let fn = function() {..}' for the same reason. function decls are global
|
||||||
let drawTimeout;
|
let drawTimeout;
|
||||||
|
|
||||||
let calcStrLength=function(str,maxLength){
|
let calcStrLength=function(str,limitLength){
|
||||||
|
|
||||||
//too long
|
//too long
|
||||||
|
|
||||||
// Example maximum length
|
// Example maximum length
|
||||||
var truncatedText = str;
|
var truncatedText = str;
|
||||||
|
|
||||||
if (str.length > maxLength) {
|
if (str.length > limitLength) {
|
||||||
truncatedText = str.substring(0, maxLength - 3) + "...";
|
truncatedText = str.substring(0, limitLength - 3) + "...";
|
||||||
}
|
}
|
||||||
|
|
||||||
return truncatedText;
|
return truncatedText;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue