[jQuery] [Treeview]: Treeview location based expand, make less sensitive to final slash
Hi Joern or anyone else for that matter,
It seems that the treeview location based expansion (to use is as
navigation) has a small "flaw". I compares tree links with the current
URL, but so strict that a final slash will not be viewed as a match.
E.g:
www.mydomain.com/category/demo/ (treelink)
www.mydomain.com/category/demo (URL)
will not match and the tree does not expand. The pertinent piece of
code is as follows:
case "location":
var current = this.find("a").filter(function() { return
this.href.toLowerCase() == location.href.toLowerCase(); });
if ( current.length ) {
current.addClass("selected").parents("ul,
li").add( current.next() ).show();
}
break;
Does anybody know how to add a "softer" comparison? I'm fairly sure
that a (programatically correct) "OR this.href.toLowerCase()+/
==location.href...... " might do the trick. But I'm not adept enough
at JS to get it right.
Any help is appreciated
Thanks