From 86728bac7ef091dba79cd3ffd3219c80f4fca8ba Mon Sep 17 00:00:00 2001 From: Scott Aslan Date: Wed, 24 May 2017 13:50:46 -0400 Subject: [PATCH] [NIFI-3925] for the jquery.combo plugin: update the calculation of the width of the combo box options overlay and also updated the plugins styles to now leverage the css calc() to determine the exact width of .combotext and .combo-option-text elements. This closes #1848 --- .../src/main/webapp/js/jquery/combo/jquery.combo.css | 3 ++- .../src/main/webapp/js/jquery/combo/jquery.combo.js | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/combo/jquery.combo.css b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/combo/jquery.combo.css index 276410415c..31c1d39714 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/combo/jquery.combo.css +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/combo/jquery.combo.css @@ -63,7 +63,7 @@ overflow: hidden; white-space: nowrap; text-overflow: ellipsis; - width: 80%; + width: calc(100% - 15px); font-weight: normal; } @@ -89,6 +89,7 @@ div.selected-disabled-option { height: 32px; font-weight: normal; line-height: 32px; + width: calc(100% - 15px); } .combo-glass-pane { diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/combo/jquery.combo.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/combo/jquery.combo.js index a8eec19f49..009f2067c4 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/combo/jquery.combo.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/combo/jquery.combo.js @@ -161,8 +161,8 @@ var comboOptions = $('
').addClass('combo-options').css({ 'position': 'absolute', 'left': position.left + 'px', - 'top': (position.top + combo.outerHeight() - 1) + 'px', - 'width': (combo.outerWidth() - 2) + 'px', + 'top': (position.top + Math.round(combo.outerHeight()) - 1) + 'px', + 'width': (Math.round(combo.outerWidth()) - 2) + 'px', 'overflow-y': 'auto' }); @@ -235,6 +235,8 @@ } } ); + } else { + optionText.css('width', '100%'); } actualHeight += 16;