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",