landmark-demo WIP

This commit is contained in:
Geoff Schmidt
2012-08-08 17:25:28 -07:00
parent a44b9205a0
commit 4ec97272b5
2 changed files with 32 additions and 3 deletions

View File

@@ -26,7 +26,7 @@ Template.redrawButtons.events = {
}
};
Template.preserveDemo.preserve = [ '.input' ];
Template.preserveDemo.preserve = [ '.keep' ];
Template.preserveDemo.x =
Template.constantDemo.x =
@@ -46,8 +46,36 @@ Template.stateDemo.timers = function () {
return Timers.find();
};
Template.stateDemo.timersRunning = function () {
return Session.get("timersRunning");
};
Template.timer.events = {
'click .delete': function () {
Timers.remove(this._id);
}
};
Template.timer.create = function () {
/*
this.when = new Date();
this.node = null;
this.timer = setInterval(function () {
}, 500);
Session.set("timersRunning", (Session.get("timersRunning") || 0) + 1);
*/
};
Template.timer.render = function (landmark) {
/*
this.node = landmark.findOne(".elapsed");
*/
};
Template.timer.destroy = function () {
/*
clearInterval(this.timer);
Session.set("timersRunning", (Session.get("timersRunning") || 0) - 1);
*/
};

View File

@@ -6,7 +6,7 @@
<h1>Landmark demo</h1>
{{> redrawButtons }}
{{> preserveDemo }}
<!--{{> constantDemo }} -->
{{> constantDemo }}
{{> stateDemo }}
</body>
@@ -20,7 +20,7 @@
<template name="preserveDemo">
<h2>Simple element preservation</h2>
X={{x}}<br>
<input type="text"><br>
<input type="text" class="keep"><br>
X={{x}}
</template>
@@ -50,6 +50,7 @@
Y={{y}}
</div>
{{/each}}
Interval timers running: {{timersRunning}}
X={{x}}
</template>