mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
landmark-demo WIP
This commit is contained in:
@@ -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);
|
||||
*/
|
||||
};
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user