From 0278c352ce1e0e2edac4e0910c6cedbb4b5a0637 Mon Sep 17 00:00:00 2001 From: zombieFox Date: Sun, 14 Jun 2020 17:02:45 +0100 Subject: [PATCH] [refactor] better modal heading string handling --- src/js/modal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/modal.js b/src/js/modal.js index e4fd862b..806f5a4a 100644 --- a/src/js/modal.js +++ b/src/js/modal.js @@ -111,7 +111,7 @@ var modal = (function() { modalControls.appendChild(actionButton); if (options.heading != null) { if (options.heading.length > _maxHeadingLength) { - options.heading = options.heading.substring(0, _maxHeadingLength) + "..."; + options.heading = options.heading.substring(0, _maxHeadingLength).replace(/\s+$/, "") + "..."; }; var modalHeading = helper.makeNode({ tag: "h1",