diff --git a/core/modules/new_widgets/link.js b/core/modules/new_widgets/link.js index f0b10b3a7..1a16b6f54 100755 --- a/core/modules/new_widgets/link.js +++ b/core/modules/new_widgets/link.js @@ -91,6 +91,7 @@ LinkWidget.prototype.handleClickEvent = function (event) { this.dispatchEvent({ type: "tw-navigate", navigateTo: this.to, + navigateFromTitle: this.getVariable("currentTiddler"), navigateFromNode: this, navigateFromClientRect: { top: bounds.top, left: bounds.left, width: bounds.width, right: bounds.right, bottom: bounds.bottom, height: bounds.height } diff --git a/core/modules/new_widgets/tiddler.js b/core/modules/new_widgets/tiddler.js index e21a20505..d76626e3c 100755 --- a/core/modules/new_widgets/tiddler.js +++ b/core/modules/new_widgets/tiddler.js @@ -16,9 +16,6 @@ var Widget = require("$:/core/modules/new_widgets/widget.js").widget; var TiddlerWidget = function(parseTreeNode,options) { this.initialise(parseTreeNode,options); - this.addEventListeners([ - {type: "tw-navigate", handler: "handleNavigateEvent"} - ]); }; /* @@ -41,7 +38,7 @@ Compute the internal state of the widget */ TiddlerWidget.prototype.execute = function() { // Get our parameters - this.tiddlerTitle = this.getAttribute("tiddler",""); + this.tiddlerTitle = this.getAttribute("tiddler",this.getVariable("currentTiddler")); // Set context variables this.setVariable("currentTiddler",this.tiddlerTitle); this.setVariable("missingTiddlerClass",(this.wiki.tiddlerExists(this.tiddlerTitle) || this.wiki.isShadowTiddler(this.tiddlerTitle)) ? "tw-tiddler-exists" : "tw-tiddler-missing"); @@ -64,14 +61,6 @@ TiddlerWidget.prototype.refresh = function(changedTiddlers) { } }; -/* -Handle a tw-navigate event -*/ -TiddlerWidget.prototype.handleNavigateEvent = function(event) { - event.navigateFromTitle = this.tiddlerTitle; - return true; -}; - exports.tiddler = TiddlerWidget; })();