0

sign drop-down now only shows rules that actually match something

This commit is contained in:
Aaron Griffith
2011-06-08 14:57:21 -04:00
parent c2bf7ff34e
commit 454c1537a6

View File

@@ -598,6 +598,11 @@ var overviewer = {
var items = []; var items = [];
for (i in overviewerConfig.objectGroups.signs) { for (i in overviewerConfig.objectGroups.signs) {
var signGroup = overviewerConfig.objectGroups.signs[i]; var signGroup = overviewerConfig.objectGroups.signs[i];
// don't create an option for this group if empty
if (overviewer.collections.markers[signGroup.label].length == 0) {
continue;
}
var iconURL = signGroup.icon; var iconURL = signGroup.icon;
if(!iconURL) { if(!iconURL) {
iconURL = overviewerConfig.CONST.image.defaultMarker; iconURL = overviewerConfig.CONST.image.defaultMarker;
@@ -616,7 +621,11 @@ var overviewer = {
} }
}); });
} }
overviewer.util.createDropDown('Signposts', items);
// only create drop down if there's used options
if (items.length > 0) {
overviewer.util.createDropDown('Signposts', items);
}
} }
// if there are any regions data, lets show the option to hide/show them. // if there are any regions data, lets show the option to hide/show them.