-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
36 lines (28 loc) · 1.05 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
var Flatsheet = require('flatsheet');
var Handlebars = require('handlebars');
var eve = require('dom-events');
var elClass = require('element-class');
var Leaflet = require('leaflet');
var domify = require('domify');
var fs = require('fs');
var fastClick = require('fastclick');
fastClick(document.body);
var flatsheet = new Flatsheet();
/* pull in template for showing info about a location */
var spaceTemplate = Handlebars.compile(fs.readFileSync('_templates/space.html', 'utf8'));
/* set image path */
L.Icon.Default.imagePath = 'node_modules/leaflet/dist/images/';
/* get the elements we'll be working with */
var list = document.getElementById('list-content');
var about = document.getElementById('about-content');
var nav = document.getElementById('top-nav');
var cards = document.querySelectorAll('.card');
flatsheet.sheet('zbckvrzp4ga27k0frnlhjq', getRows);
function getRows (error, response) {
var rows = response.rows;
var l = rows.length;
for (var i=0; i<l; i++){
var html = domify(spaceTemplate(rows[i]));
list.appendChild(html);
}
}