1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 06:51:10 +03:00

Merge pull request #4411 from mabashian/workflow-start-node-width

Makes workflow start node width dynamic to account for languages other than English

Reviewed-by: Michael Abashian
             https://github.com/mabashian
This commit is contained in:
softwarefactory-project-zuul[bot] 2019-08-03 13:43:58 +00:00 committed by GitHub
commit 481df40764
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 = $(`<span class="WorkflowChart-node" style="visibility:hidden;"><span class="WorkflowChart-startText">${TemplatesStrings.get('workflow_maker.START')}</span></span>`);
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,