> That's *not* one of mine!
It's one of Saq's plugins....
http://tw.lewcid.org/#TiddlerWithEditPlugin
I think the problem is here:
---------------------
config.macros.tiddler.handler = function(place,macroName,params){
oldTiddlerHandler.apply(this,arguments);
place.lastChild.setAttribute("source",params[0]);
place.lastChild.ondblclick = this.onTiddlerMacroDblClick;
}
---------------------
The 1st line invokes the core <<tiddler>> handler to create a
container in which the transcluded content is rendered. Then, the
following two lines refer to 'place.lastChild' to modify the container
by setting an attribute and adding a double-click handler.
However, if the transcluded tiddler doesn't exist, the <<tiddler>>
macro doesn't produce a container element, and the subsequent
reference to place.lastChild triggers the error you reported.
To correct this, you could add some extra conditionals in the
function:
---------------------
config.macros.tiddler.handler = function(place,macroName,params){
oldTiddlerHandler.apply(this,arguments);
if (!place.lastChild) return;
if (place.lastChild.getAttribute("tiddler")!=params[0]) return;
place.lastChild.setAttribute("source",params[0]);
place.lastChild.ondblclick = this.onTiddlerMacroDblClick;
}
---------------------
The first "if" ensures that SOME element was rendered. The second
"if" ensures that the rendered element is actually the result of
transcluding the requested tiddler content and not merely some
previously rendered element already contained in the 'place'.
-e
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/tiddlywiki?hl=en.