Skip to content

Commit

Permalink
show sums in hover
Browse files Browse the repository at this point in the history
  • Loading branch information
tursics committed Feb 18, 2018
1 parent 599d0b6 commit 442c10f
Showing 1 changed file with 25 additions and 11 deletions.
36 changes: 25 additions & 11 deletions karte-span-2018.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,22 @@ var hover = {
offset: L.point(0, -32),
className: 'printerLabel'
},
str = '';
str = '',
val = 0,
item,
itemObj;

for (itemObj in dataObj.data) {
if (dataObj.data.hasOwnProperty(itemObj)) {
item = dataObj.data[itemObj];
if (item.BSN === data.BSN) {
val += item.Ausgaben2018;
}
}
}

str += '<div class="top ' + icon.options.markerColor + '">' + data.Name + '</div>';
str += '<div class="middle">€' + formatNumber(data.Ausgaben2018) + '</div>';
str += '<div class="middle">€' + formatNumber(val) + '</div>';
str += '<div class="bottom ' + icon.options.markerColor + '">' + 'Ausgaben für 2018' + '</div>';

this.layerPopup = L.popup(options)
Expand Down Expand Up @@ -180,17 +192,19 @@ var info = {
}

for (itemObj in dataObj.data) {
item = dataObj.data[itemObj];
if (item.BSN === data.BSN) {
dom = $.parseHTML(this.templateItem);

for (key in item) {
if (item.hasOwnProperty(key)) {
setTextWithDOM(dom, key, item[key]);
if (dataObj.data.hasOwnProperty(itemObj)) {
item = dataObj.data[itemObj];
if (item.BSN === data.BSN) {
dom = $.parseHTML(this.templateItem);

for (key in item) {
if (item.hasOwnProperty(key)) {
setTextWithDOM(dom, key, item[key]);
}
}
}

$('#dom').append(dom);
$('#dom').append(dom);
}
}
}

Expand Down

0 comments on commit 442c10f

Please sign in to comment.