From 91185ef847c02d68bd9f2f91248747bdd429d07f Mon Sep 17 00:00:00 2001 From: mpeltriaux Date: Wed, 16 Feb 2022 08:31:18 +0100 Subject: [PATCH] #112 Tree filter case insensitive search * adds case insensitive search for TreeWidget --- konova/templates/konova/widgets/checkbox-tree-select.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/konova/templates/konova/widgets/checkbox-tree-select.html b/konova/templates/konova/widgets/checkbox-tree-select.html index 3129be8a..c2b107cc 100644 --- a/konova/templates/konova/widgets/checkbox-tree-select.html +++ b/konova/templates/konova/widgets/checkbox-tree-select.html @@ -41,7 +41,11 @@ var elem = $(this); var val = elem.val() var allTreeElements = $(".tree-element") - var allTreeElementsContain = $(".tree-element:contains(" + val + ")") + var allTreeElementsContain = $(".tree-element").filter(function(){ + var reg = new RegExp(val, "i"); + return reg.test($(this).text()); + } + ); if(val.length > 0){ allTreeElements.hide() allTreeElementsContain.show()