Refactored wiki event mechanism to support multiple event types

This commit is contained in:
Jeremy Ruston
2013-03-16 10:42:46 +00:00
parent 623a3ec8f8
commit c3b57507b0
5 changed files with 33 additions and 26 deletions

View File

@@ -69,7 +69,7 @@ Modal.prototype.display = function(title,options) {
headerRenderTree = new $tw.WikiRenderTree(headerParser,{wiki: $tw.wiki});
headerRenderTree.execute({tiddlerTitle: title});
headerRenderTree.renderInDom(headerTitle);
this.wiki.addEventListener("",function(changes) {
this.wiki.addEventListener("change",function(changes) {
headerRenderTree.refreshInDom(changes);
});
// Render the body of the message
@@ -77,7 +77,7 @@ Modal.prototype.display = function(title,options) {
bodyRenderTree = new $tw.WikiRenderTree(bodyParser,{wiki: $tw.wiki});
bodyRenderTree.execute({tiddlerTitle: title});
bodyRenderTree.renderInDom(modalBody);
this.wiki.addEventListener("",function(changes) {
this.wiki.addEventListener("change",function(changes) {
bodyRenderTree.refreshInDom(changes);
});
// Setup the link if present
@@ -105,7 +105,7 @@ Modal.prototype.display = function(title,options) {
footerRenderTree = new $tw.WikiRenderTree(footerParser,{wiki: $tw.wiki});
footerRenderTree.execute({tiddlerTitle: title});
footerRenderTree.renderInDom(modalFooterButtons);
this.wiki.addEventListener("",function(changes) {
this.wiki.addEventListener("change",function(changes) {
footerRenderTree.refreshInDom(changes);
});
// Add the close event handler