Commit cf937c0d authored by haemmer's avatar haemmer
Browse files

Added patch to hide empty categories

parent fa4c98a0
......@@ -168,7 +168,7 @@ div.idd_list {
font-size: 12px;
padding-bottom: 2px;
font-weight: bold;
text-align: left
text-align: left;
}
/* Dropdown list items except group headers */
......@@ -176,14 +176,14 @@ div.idd_list {
font-family:Verdana, sans-serif;
font-size: 12px;
height: 1em;
margin: 0px;
margin: 0;
padding-bottom: 2px;
text-align:left;
}
/* Dropdown list items nested under group headers */
.idd_listItem_Nested {
padding-left: 15px;
margin-left: 15px;
display: block;
}
......
......@@ -528,7 +528,7 @@ function positionList(listControl) {
childItems.css('width', listWidthPx + 'px');
// Add some margin for compensating scrollbar
listControl.css('width', (listWidthPx + 15) + 'px');
listControl.css('width', (listWidthPx + 20) + 'px');
} catch (err) { /*eat any sizing errors */ }
}
......@@ -573,7 +573,26 @@ function updateListFilter(textControl) {
var anyMatches = Boolean(listItems.filter(':visible').length!=0);
listControl.children('.idd_listItemGroupHeader').toggle(anyMatches);
listControl.children('.grpHdrNoMatches').toggle(!anyMatches);
// Hide visible but empty categories
var previousElement = null;
var allListItems = listControl.children().filter(':visible');
allListItems.each(
function () {
if ($(this).hasClass("idd_listItemGroupHeader")){
if (previousElement != null && previousElement.hasClass("idd_listItemGroupHeader")){
//alert("Hide " + previousElement.text())
previousElement.hide();
}
}
previousElement = $(this);
});
// Hide last visible item if it is a category
if (allListItems.last().hasClass("idd_listItemGroupHeader")){
allListItems.last().hide();
}
positionList(listControl); //resize list to fit new visible elements.
}
......@@ -583,7 +602,7 @@ function doesListItemMach(listItem, compareText) {
if (listItem.attr('savedValue') == '-'){
return false;
}
// Compares a listItem (jQuery object representing item in dropdown list) to compareText
return (!listItem.hasClass('idd_listItem_Disabled')) && (stringContainsCaseInsensitive(listItem.text(), compareText) || stringContainsCaseInsensitive(listItem.attr('savedTitle'), compareText))
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment