v. 0.60.13b

Enhancement: Borders highlight
This commit is contained in:
Azgaar 2018-09-29 00:33:52 +03:00
parent f3cb6d8c73
commit fe239ce29b
2 changed files with 13 additions and 6 deletions

View file

@ -74,7 +74,7 @@ button, select, a {
} }
#regions { #regions {
stroke-width: 0; stroke-width: 2;
stroke: none; stroke: none;
fill-rule: evenodd; fill-rule: evenodd;
stroke-linejoin: round; stroke-linejoin: round;

View file

@ -8481,6 +8481,7 @@ function fantasyMap() {
countriesFooterArea.innerHTML = si(totalArea) + unit; countriesFooterArea.innerHTML = si(totalArea) + unit;
countriesFooterPopulation.innerHTML = si(totalPopulation); countriesFooterPopulation.innerHTML = si(totalPopulation);
// handle events // handle events
$("#countriesBody .states").hover(focusOnState, unfocusState);
$(".enlange").click(function() { $(".enlange").click(function() {
const s = +(this.parentNode.id).slice(5); const s = +(this.parentNode.id).slice(5);
const capital = states[s].capital; const capital = states[s].capital;
@ -8498,7 +8499,7 @@ function fantasyMap() {
$("div[aria-describedby='burgsEditor'] .ui-dialog-title").text("Burgs of " + this.value).prepend(color); $("div[aria-describedby='burgsEditor'] .ui-dialog-title").text("Burgs of " + this.value).prepend(color);
} }
} }
}).hover(focusStates, unfocus); });
$(".states > .stateColor").on("change", function() { $(".states > .stateColor").on("change", function() {
const s = +(this.parentNode.id).slice(5); const s = +(this.parentNode.id).slice(5);
states[s].color = this.value; states[s].color = this.value;
@ -8832,10 +8833,16 @@ function fantasyMap() {
} }
// onhover style functions // onhover style functions
function focusStates() { function focusOnState() {
const s = +(this.parentNode.id).slice(5); const s = +(this.id).slice(5);
const l = labels.select("#regionLabel" + s); labels.select("#regionLabel" + s).classed("drag", true);
l.classed("drag", true); document.getElementsByClassName("region" + s)[0].style.stroke = "#000000";
}
function unfocusState() {
const s = +(this.id).slice(5);
labels.select("#regionLabel" + s).classed("drag", false);
document.getElementsByClassName("region" + s)[0].style.stroke = "none";
} }
function focusCapital() { function focusCapital() {