-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdock.js
executable file
·42 lines (35 loc) · 890 Bytes
/
dock.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
37
38
39
40
41
42
if (Meteor.isClient) {
// counter starts at 0
Session.setDefault("counter", 0);
Session.setDefault("dragon", 0);
Template.hello.helpers({
counter: function () {
return Session.get("counter");
}
});
Template.hello.events({
'click button': function () {
// increment the counter when button is clicked
Session.set("counter", Session.get("counter") + 1);
}
});
Template.dock.helpers({
dragon: function() {
return Session.get("dragon");
}
});
Template.dock.events({
'click .app': function(e) {
// increment the counter when button is clicked
var s=e.currentTarget.id;
console.log('You clicked Dragon # ',s);
Session.set("dragon", s);
$('#dragonexit').trigger('click');
}
});
}
if (Meteor.isServer) {
Meteor.startup(function () {
// code to run on server at startup
});
}