diff --git a/awx/ui/static/js/shared/truncated-text.directive.js b/awx/ui/static/js/shared/truncated-text.directive.js index 4618a2ad24..0629fd8478 100644 --- a/awx/ui/static/js/shared/truncated-text.directive.js +++ b/awx/ui/static/js/shared/truncated-text.directive.js @@ -2,11 +2,22 @@ function link($compile, scope, element, attrs) { + // If the element is a DOM comment, that means + // it's been hidden with `ng-if` so don't try + // to process it or we get an error! + if (element[0].nodeType === 8) { + element = element.next(); + + // Element was removed due to `ng-if`, so don't + // worry about it + if (element.length === 0) { + return; + } + } + + function elementTextWillWrap(element) { - // If the element is a DOM comment, that means - // it's been hidden with `ng-if` so don't try - // to process it or we get an error! if (element[0].nodeType === 8) { return false; } @@ -26,6 +37,7 @@ function link($compile, scope, element, attrs) { } function addTitleIfWrapping(text) { + if (elementTextWillWrap(element)) { element .addClass('u-truncatedText') @@ -43,8 +55,6 @@ export default ['$compile', function($compile) { return { - priority: 1000, // make sure this gets compiled - // before `title` link: _.partial(link, $compile) }; } diff --git a/awx/ui/static/js/system-tracking/fact-data-table/fact-data-table.partial.html b/awx/ui/static/js/system-tracking/fact-data-table/fact-data-table.partial.html index 5c3f44d647..44df785f58 100644 --- a/awx/ui/static/js/system-tracking/fact-data-table/fact-data-table.partial.html +++ b/awx/ui/static/js/system-tracking/fact-data-table/fact-data-table.partial.html @@ -28,12 +28,12 @@
{{group.facts.keyName}} - + {{value}} - + {{value}} @@ -63,10 +63,10 @@ {{fact.keyPath[0]}}.{{fact.keyName}} - + {{fact.value1}} - + {{fact.value2}}