diff --git a/core/modules/macros/reveal.js b/core/modules/macros/reveal.js index 6d53cab41..2b39bf3cd 100644 --- a/core/modules/macros/reveal.js +++ b/core/modules/macros/reveal.js @@ -21,7 +21,8 @@ exports.info = { qualifyTiddlerTitles: {byName: true, type: "text"}, "default": {byName: true, type: "text"}, "class": {byName: true, type: "text"} - } + }, + events: ["click"] }; exports.readState = function() { @@ -63,6 +64,14 @@ exports.readPopupState = function(state) { } }; +exports.handleEvent = function(event) { + if(event.type === "click") { + // Cancel the popup if we get a click on it + var tiddler = this.wiki.getTiddler(this.stateTitle); + this.wiki.addTiddler(new $tw.Tiddler(tiddler,{title: this.stateTitle, text: ""}),true); + } +}; + exports.executeMacro = function() { this.stateTitle = this.params.state; if(this.hasParameter("qualifyTiddlerTitles")) {