From b3002e0b9d38a4d29943c0309538890acb43f4b2 Mon Sep 17 00:00:00 2001 From: mabashian Date: Thu, 1 Aug 2019 10:29:33 -0400 Subject: [PATCH] Makes workflow start node width dynamic to account for languages other than english --- .../workflows/workflow-chart/workflow-chart.directive.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/src/templates/workflows/workflow-chart/workflow-chart.directive.js b/awx/ui/client/src/templates/workflows/workflow-chart/workflow-chart.directive.js index b9934bef07..fb98fb05d0 100644 --- a/awx/ui/client/src/templates/workflows/workflow-chart/workflow-chart.directive.js +++ b/awx/ui/client/src/templates/workflows/workflow-chart/workflow-chart.directive.js @@ -23,9 +23,16 @@ export default ['moment', '$timeout', '$window', '$filter', 'TemplatesStrings', restrict: 'E', link: function(scope, element) { + // Quickly render the start text so we see how wide it is and know how wide to make the start + // node element. + const startNodeText = $(``); + startNodeText.appendTo(document.body); + const startNodeTextWidth = startNodeText.width(); + startNodeText.remove(); + let nodeW = 180, nodeH = 60, - rootW = 60, + rootW = startNodeTextWidth + 25, rootH = 40, startNodeOffsetY = scope.mode === 'details' ? 17 : 10, maxNodeTextLength = 27,