diff --git a/src/js/textboxJS.js b/src/js/textboxJS.js index d0798dbd0c6c486764a2a1a31904d9e40713e233..cb5213593f77e0f4021a7174b771459b7c0be3c0 100644 --- a/src/js/textboxJS.js +++ b/src/js/textboxJS.js @@ -1,27 +1,27 @@ /* eslint-disable no-undef */ /* Nicked off greyelf, works for replace textboxes */ window.setReplaceTextboxMaxLength = function (storyVarName, maxLength) { - var textboxId = '#textbox-' + Util.slugify(storyVarName); + const textboxId = `#textbox-${ Util.slugify(storyVarName)}`; $(textboxId) - .attr('maxlength', maxLength) + .attr("maxlength", maxLength) .css({ - 'min-width' : 'initial', - width : maxLength + 'em', - padding : '3px 2px' + "min-width": "initial", + "width": `${maxLength }em`, + "padding": "3px 2px" }); }; /* Nicked off TheMadExile, works for non-replace textboxes */ window.setTextboxMaxLength = function (storyVarName, maxLength) { - var textboxId = '#textbox-' + Util.slugify(storyVarName); - postdisplay[textboxId + '-maxlength'] = function (taskName) { + const textboxId = `#textbox-${ Util.slugify(storyVarName)}`; + postdisplay[`${textboxId }-maxlength`] = function (taskName) { delete postdisplay[taskName]; $(textboxId) - .attr('maxlength', maxLength) + .attr("maxlength", maxLength) .css({ - 'min-width' : 'initial', - width : maxLength + 'em', - padding : '3px 2px' + "min-width": "initial", + "width": `${maxLength }em`, + "padding": "3px 2px" }); }; };