From 74c34dbf763a6a32bd7c5222ad7e39d8b484cbf5 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Tue, 11 May 2021 17:46:05 +0200 Subject: [PATCH] prettier map.js --- static/js/map.js | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/static/js/map.js b/static/js/map.js index 0e7f063..bb70b6f 100644 --- a/static/js/map.js +++ b/static/js/map.js @@ -119,7 +119,6 @@ function update_wikidata(check_for_missing = true) { if (missing_qids.length) { var params = { qids: missing_qids.join(",") }; axios.get(missing_url, { params: params }).then((response) => { - response.data.isa_count.forEach((isa) => { isa_labels[isa.qid] = isa.label; if (isa_count[isa.qid] === undefined) { @@ -289,25 +288,32 @@ function mouseover(item) { item.outline.setStyle({ fillOpacity: 0.2, weight: 6 }); } if (item.lines) { - item.lines.forEach((line) => { line.setStyle({ weight: 6}); }); + item.lines.forEach((line) => { + line.setStyle({ weight: 6 }); + }); } - -}; +} function mouseout(item) { if (item.outline) { item.outline.setStyle({ fillOpacity: 0, weight: 3 }); } if (item.lines) { - item.lines.forEach((line) => { line.setStyle({ weight: 3}); }); + item.lines.forEach((line) => { + line.setStyle({ weight: 3 }); + }); } -}; +} function mouse_events(marker, qid) { items[qid] ||= {}; var item = items[qid]; - marker.on("mouseover", function() { mouseover(item); }); - marker.on("mouseout", function() { mouseout(item); }); + marker.on("mouseover", function () { + mouseover(item); + }); + marker.on("mouseout", function () { + mouseout(item); + }); item.markers ||= []; item.markers.push(marker); @@ -340,7 +346,6 @@ function process_wikidata_items(load_items) { if (items[qid] === undefined) items[qid] = {}; items[qid].isa_list = item.isa_list; - }); }