Added dropdown close on blur for zones dropdown.

Added zones sorting in dropdown menu.
This commit is contained in:
Revertron
2021-04-25 19:54:36 +02:00
parent 7bee4bc61c
commit ef38315452
2 changed files with 19 additions and 2 deletions
+17
View File
@@ -432,8 +432,25 @@ function keystoreChanged(path, pub_key, hash) {
new_zone_difficulty.disabled = false;
}
function closeZonesDropdown() {
// If we close this right on blur we loose item clicks
setTimeout(function(){
document.getElementById("zones-dropdown").className = "dropdown";
}, 100);
}
function refreshZonesList() {
var buf = "";
availableZones.sort(function compare(rhs, lhs) {
if (rhs.name < lhs.name) {
return -1;
} else if (rhs.name > lhs.name) {
return 1;
} else {
return 0;
}
});
availableZones.forEach(function(value, index, array) {
var zone = value.name + " (" + value.difficulty + "🔥)";
var add_class = "";