1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 12:07:19 +00:00

Added support for rendering and refreshing the window title

This commit is contained in:
Jeremy Ruston 2012-02-17 12:34:28 +00:00
parent c23014dca4
commit 56eb3dc1dc

View File

@ -102,6 +102,17 @@ var App = function() {
// Open the PageTemplate // Open the PageTemplate
var renderer = new Renderer("PageTemplate",null,this.store); var renderer = new Renderer("PageTemplate",null,this.store);
renderer.renderInDom(document.body); renderer.renderInDom(document.body);
// Register an event handler to handle refreshing the DOM
this.store.addEventListener("",function(changes) {
renderer.refreshInDom(changes);
});
// Set the page title and refresh it when needed
var titleRenderer = new Renderer("WindowTitle",null,this.store);
document.title = titleRenderer.render("text/plain");
this.store.addEventListener("",function(changes) {
titleRenderer.refresh(changes);
document.title = titleRenderer.render("text/plain");
});
// Set up a timer to change the value of a tiddler // Set up a timer to change the value of a tiddler
var me = this; var me = this;
window.setInterval(function() { window.setInterval(function() {
@ -110,10 +121,6 @@ var App = function() {
text: "The time was recently " + (new Date()).toString() text: "The time was recently " + (new Date()).toString()
})); }));
},3000); },3000);
// Register an event handler to handle refreshing the DOM
this.store.addEventListener("",function(changes) {
renderer.refreshInDom(changes);
});
} }
}; };