Am Mittwoch, 9. April 2014 16:56:54 UTC+2 schrieb Jeremy Ruston:
>
> Hi Stephan
>
> You'd have to pass a reference to the implementation of handleInputEvent. 
> Something like this:
>
> var self = this;
> ...
> jscolor.color( domNode, { hash : true, onImmediateChange : 
> self.handleInputEvent 
> } );
>

I don't get it :(

the handleInputEvent is attached to the domNode, right? So this is what I 
*thought* should work:

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".

-- 
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