-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathractive-init.js
More file actions
26 lines (23 loc) · 972 Bytes
/
ractive-init.js
File metadata and controls
26 lines (23 loc) · 972 Bytes
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
var reactive = new Ractive({
// The `el` option can be a node, an ID, or a CSS selector.
el: '.slides',
// We could pass in a string, but for the sake of convenience
// we're passing the ID of the script tag above.
template: '#slides_template',
// Here, we're passing in some initial data
data: {pastEvents: schedule.pastEvents(),
currentEvent: schedule.currentEvent(),
nextEvent: schedule.nextEvent(),
futureEvents: schedule.futureEvents(),
eventCount: schedule.allEvents().length}
});
function refreshEvent() {
schedule.update();
reactive.set({pastEvents: schedule.pastEvents(),
currentEvent: schedule.currentEvent(),
nextEvent: schedule.nextEvent(),
futureEvents: schedule.futureEvents(),
eventCount: schedule.allEvents().length,
now: schedule.now(),
room: schedule.room()});
}