I'm using dynatree 1.2.4, and add a class to some titles onRender so I can
differentiate them visually, ie
if(node.data.my_folder !== true) {
$(nodeSpan).find('.dynatree-title').addClass('not-mine');
};
This, however, breaks my onClick function and prevents it from firing:
onClick: function(node, event) {
if(node.getEventTargetType(event) === "title"){
//change another pane in the page, do some other stuff
};
It turns out that under the covers, node.getEventTargetType is checking to see
if the class name is === this.tree.options.classNames, which only contains the
original "dynatree-title" class. Thus node.getEventTargetType returns false,
when in fact i am clicking on the title. My patch looks at whether string
dynatree-title is contained in the set of classes. I wanted to check if there
was a better/faster way to do this though, or alternative supported method.
Here is the original code from the function getEventTargetType, followed by my
patch:
original:
if( tcn === cns.title ){
return "title";
};
patch:
if( tcn.indexOf(cns.title ) !== -1 ) {
return "title";
};
Original issue reported on code.google.com by john.a.s...@gmail.com on 22 Apr 2013 at 4:18
Original issue reported on code.google.com by
john.a.s...@gmail.com
on 22 Apr 2013 at 4:18