diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/combo/jquery.combo.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/combo/jquery.combo.js index 30f0be9ba1..fdcae440ba 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/combo/jquery.combo.js +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/combo/jquery.combo.js @@ -46,6 +46,13 @@ * The optionClass option supports specifying a class to apply to the * option element. */ + +/** + * jQuery plugin for a NiFi style combo box. + * + * @param {type} $ + * @returns {undefined} + */ (function ($) { var isUndefined = function (obj) { @@ -93,7 +100,7 @@ // ensure we found the selected option if (isDefinedAndNotNull(selectedOption)) { - $(comboText).removeClass('selected-disabled-option').attr('title', selectedOption.text).text(selectedOption.text).data('text', selectedOption.text).width(combo.outerWidth() - 25); + comboText.removeClass('selected-disabled-option').attr('title', selectedOption.text).text(selectedOption.text).data('text', selectedOption.text).width(combo.outerWidth() - 25); // if the selected option is disabled show it if (selectedOption.disabled === true) { @@ -112,6 +119,7 @@ }; var methods = { + /** * Initializes the combo box. * @@ -130,24 +138,24 @@ combo.empty().unbind().data('options', options); // add a div to hold the text - var comboText = $('
').appendTo(combo); + $('').appendTo(combo); // add hover effect and handle a combo click combo.addClass('button-normal pointer combo').hover(function () { - $(combo).removeClass('button-normal').addClass('button-over'); + combo.removeClass('button-normal').addClass('button-over'); }, function () { - $(combo).removeClass('button-over').addClass('button-normal'); + combo.removeClass('button-over').addClass('button-normal'); }).click(function (event) { // determine the position of the element in question - var position = $(combo).offset(); + var position = combo.offset(); // create the combo box options beneath it var comboOptions = $('').addClass('combo-options').css({ 'position': 'absolute', 'left': position.left + 'px', - 'top': (position.top + $(combo).outerHeight() + 1) + 'px', - 'width': ($(combo).outerWidth() - 10) + 'px', + 'top': (position.top + combo.outerHeight() + 1) + 'px', + 'width': (combo.outerWidth() - 10) + 'px', 'overflow-y': 'auto' }); @@ -195,7 +203,7 @@ $('