Hi Stephan

I don't get it :(
>
> the handleInputEvent is attached to the domNode, right? So this is what I
> *thought* should work:
>

No, the handleInputEvent is a method on the edit-text widget.


>
> EditTextWidget.prototype.postRender = function() {
>     var domNode = this.domNodes[0];
>     if($tw.browser && this.document !== $tw.fakeDocument &&
> domNode.getAttribute("type") === "color") {
>         jscolor.color( domNode, { hash : true, onImmediateChange :
> domNode.handleInputEvent } );
>     }
> };
>
> I also ried:
>
> EditTextWidget.prototype.postRender = function() {
>     var domNode = this.domNodes[0];
>     if($tw.browser && this.document !== $tw.fakeDocument &&
> domNode.getAttribute("type") === "color") {
>         jscolor.color( domNode, { hash : true, onImmediateChange :
> this.handleInputEvent } );
>     }
> };
>
> But this throws JavaScript errors telling me that "this.domNodes is
> undefined".
>

I don't know enough about how jscolor works. I'd expect it to be invoked on
an input element, and to augment that element with additional DOM nodes for
the colour picker. Does it hide the original input element, or try to
delete it?

this.domNodes is an array of the DOM nodes generated by a widget. The
widget is responsible for maintaining it as it creates and deletes DOM
nodes.

It might be helpful if you could share more of your code?

Best wishes

Jeremy



-- 
Jeremy Ruston
mailto:[email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/d/optout.

Reply via email to