Skip to content

Commit 9a1f9c2

Browse files
committed
import and var fixes
1 parent 8568ae9 commit 9a1f9c2

2 files changed

Lines changed: 29 additions & 26 deletions

File tree

src/js/core.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
// jQuery + Bootstrap
2-
var $ = jQuery = require("jquery");
2+
var $ = require('../../node_modules/jquery/dist/jquery')
3+
window.jQuery = $;
4+
window.$ = $;
35
require("bootstrap");

src/js/datatable.js

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
var $ = jQuery;
1+
var $ = require('../../node_modules/jquery/dist/jquery')
2+
window.jQuery = $;
3+
window.$ = $;
24
require("datatables.net-bs")(window, $);
35
require("datatables.net-buttons-bs")(window, $);
46
require("datatables.net-select-bs")(window, $);
@@ -12,7 +14,8 @@ $(function () {
1214
// table things
1315
var fishfryTable;
1416
// map-to-table things
15-
var lookupLayerIdFfid, lookupLayerIdFfid
17+
var lookupFfidLayerId = {}
18+
var lookupLayerIdFfid = {}
1619

1720
/** -----------------------------------------
1821
* MAP SETUP
@@ -26,9 +29,9 @@ $(function () {
2629

2730
L.tileLayer(
2831
"https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png", {
29-
maxZoom: 18,
30-
attribution: 'Tiles via <a href="http://carto.com">Carto</a>. Basemap data from <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a> license.'
31-
}
32+
maxZoom: 18,
33+
attribution: 'Tiles via <a href="http://carto.com">Carto</a>. Basemap data from <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a> license.'
34+
}
3235
).addTo(map);
3336

3437
$.getJSON("https://services1.arcgis.com/vdNDkVykv9vEWFX4/ArcGIS/rest/services/Catholic_Churches_in_Allegheny_County/FeatureServer/0/query?where=1%3D1&outFields=name%2Curl%2Cphone_number%2Cemail&returnGeometry=true&outSR=4326&f=pgeojson", (data) => {
@@ -41,11 +44,11 @@ $(function () {
4144
}).bindPopup(
4245
L.Util.template(
4346
"<h5>{0}</h5><p><a href='{1}' target='_blank'>website&rarr;</a></p><p>email: {2}<br>phone: {3}</p>", {
44-
0: pt.properties.name,
45-
1: pt.properties.url,
46-
2: pt.properties.email,
47-
3: pt.properties.phone_number
48-
}
47+
0: pt.properties.name,
48+
1: pt.properties.url,
49+
2: pt.properties.email,
50+
3: pt.properties.phone_number
51+
}
4952
)
5053
);
5154
}
@@ -132,25 +135,25 @@ $(function () {
132135
layer.bindPopup(
133136
L.Util.template(
134137
"<h3>{0}</h3><h5>{1}</h5><p><a href={5} target='_blank'>Go to Venue Website &rarr;</a></p><p>Validated?: {2}<br>Published?: {3}</p><p><a href='{4}'>Edit This &rarr;</a></p>", {
135-
0: p.venue_name,
136-
1: p.venue_address,
137-
2: p.validated,
138-
3: p.publish,
139-
4: edit_link,
140-
5: p.website
141-
}
138+
0: p.venue_name,
139+
1: p.venue_address,
140+
2: p.validated,
141+
3: p.publish,
142+
4: edit_link,
143+
5: p.website
144+
}
142145
)
143146
);
144147
} else {
145148
layer.bindPopup(
146149
L.Util.template(
147150
"<h3>{0}</h3><h5>{1}</h5><p>Validated?: {2}<br>Published?: {3}</p><p><a href='{4}'>Edit This &rarr;</a></p>", {
148-
0: p.venue_name,
149-
1: p.venue_address,
150-
2: p.validated,
151-
3: p.publish,
152-
4: edit_link
153-
}
151+
0: p.venue_name,
152+
1: p.venue_address,
153+
2: p.validated,
154+
3: p.publish,
155+
4: edit_link
156+
}
154157
)
155158
);
156159
}
@@ -172,8 +175,6 @@ $(function () {
172175
// --------------------------------------
173176
// Leaflet ID to FFID lookup, used for map-table interactivity
174177

175-
lookupLayerIdFfid = {}
176-
lookupFfidLayerId = {}
177178
Object.keys(fishfryLayer._layers).forEach((k) => {
178179
lookupLayerIdFfid[k] = fishfryLayer._layers[k].feature.id;
179180
lookupFfidLayerId[fishfryLayer._layers[k].feature.id] = k;

0 commit comments

Comments
 (0)