From 25f65d0f6bd061facf88dab5859ddef1926dfecc Mon Sep 17 00:00:00 2001 From: Anaël Closson Date: Thu, 7 Sep 2017 10:50:24 +0200 Subject: Incorrect select field filtering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The filtering of select input fields was incorrectly handled and resulte in inconsistent state Issue-Id: CLAMP-49 Change-Id: I1678a861ca4fcb8b384fb75356ff95eee88f2fc6 Signed-off-by: Anaël Closson --- .../partials/portfolios/holmes_properties.html | 2 +- .../portfolios/stringMatch_properties.html | 4 +- .../partials/portfolios/tca_properties.html | 4 +- .../META-INF/resources/designer/scripts/aOnBoot.js | 77 ++++++++-------------- 4 files changed, 31 insertions(+), 56 deletions(-) diff --git a/src/main/resources/META-INF/resources/designer/partials/portfolios/holmes_properties.html b/src/main/resources/META-INF/resources/designer/partials/portfolios/holmes_properties.html index 98c64323..3c7607b9 100644 --- a/src/main/resources/META-INF/resources/designer/partials/portfolios/holmes_properties.html +++ b/src/main/resources/META-INF/resources/designer/partials/portfolios/holmes_properties.html @@ -46,7 +46,7 @@
-
diff --git a/src/main/resources/META-INF/resources/designer/partials/portfolios/stringMatch_properties.html b/src/main/resources/META-INF/resources/designer/partials/portfolios/stringMatch_properties.html index 75491185..018a4535 100644 --- a/src/main/resources/META-INF/resources/designer/partials/portfolios/stringMatch_properties.html +++ b/src/main/resources/META-INF/resources/designer/partials/portfolios/stringMatch_properties.html @@ -227,7 +227,7 @@ label{
@@ -972,4 +972,4 @@ label{ $(".stringMatchPanel").css("display", "unset"); } - \ No newline at end of file + diff --git a/src/main/resources/META-INF/resources/designer/partials/portfolios/tca_properties.html b/src/main/resources/META-INF/resources/designer/partials/portfolios/tca_properties.html index 3219fe43..7305fd91 100644 --- a/src/main/resources/META-INF/resources/designer/partials/portfolios/tca_properties.html +++ b/src/main/resources/META-INF/resources/designer/partials/portfolios/tca_properties.html @@ -197,7 +197,7 @@
- +
@@ -620,4 +620,4 @@ }); } - \ No newline at end of file + diff --git a/src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js b/src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js index 97dd42e1..01a39b62 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js +++ b/src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js @@ -113,61 +113,36 @@ function loadPropertyWindow(type) { function setMultiSelect() { $("select").each(function(index, mySelect) { - if ($(mySelect).parents(".multiselect-native-select") && - $(mySelect).parents(".multiselect-native-select").length < 1) { - if (!$(mySelect).attr("multiple")) { - if ($(mySelect).attr("enableFilter")) { - $(mySelect).multiselect({ - numberDisplayed: 1, - maxHeight: 200 - }); - } else { - $(mySelect).multiselect({ - numberDisplayed: 1, - enableFiltering: true, - maxHeight: 200 - }); - } - } else { - $(mySelect).multiselect({ - numberDisplayed: 1, - includeSelectAllOption: true, - enableFiltering: true, - maxHeight: 200, - enableCaseInsensitiveFiltering: true - }); - } + var mySelectObj = $(mySelect); + if (! mySelectObj.parents(".multiselect-native-select")) { + // keep native for this one + return; + } - } else if ($(mySelect).parents(".multiselect-native-select") && - $(mySelect).parents(".multiselect-native-select").length > 0) { - var selectDrop = $(mySelect).parent(".multiselect-native-select").find("select"); - $(mySelect).parent(".multiselect-native-select").parent().html(selectDrop); - if (!$(mySelect).attr("multiple")) { - if ($(mySelect).attr("enableFilter")) { - $(mySelect).multiselect({ - numberDisplayed: 1, - maxHeight: 200 - }); - } else { - $(mySelect).multiselect({ - numberDisplayed: 1, - enableFiltering: true, - maxHeight: 200 - }); - } - } else { - $(mySelect).multiselect({ - numberDisplayed: 1, - includeSelectAllOption: true, - enableFiltering: true, - maxHeight: 200, - enableCaseInsensitiveFiltering: true - }); - } + if (mySelectObj.parents(".multiselect-native-select").length > 0) { + var selectDrop = mySelectObj.parent(".multiselect-native-select").find("select"); + mySelectObj.parent(".multiselect-native-select").parent().html(selectDrop); } + + var options = { + numberDisplayed: 1, + maxHeight: 200 + }; + + if (mySelectObj.attr("multiple") + && mySelectObj.attr("multiple") != 'false') { + options.includeSelectAllOption = true; + } + + if (mySelectObj.attr("enableFilter") + && mySelectObj.attr("enableFilter") != 'false') { + options.enableCaseInsensitiveFiltering = true; + options.enableFiltering = true; + } + + mySelectObj.multiselect(options); }); - //refeshMultiSelect(); } function loadSharedPropertyByService(onChangeUUID, refresh, callBack) { -- cgit 1.2.3-korg