navigation MDL-20557 Made navigation icons part of the link for that item so it is clickable

This commit is contained in:
samhemelryk
2009-10-14 09:27:07 +00:00
parent 6644741db6
commit 1c4eef5795
2 changed files with 25 additions and 13 deletions
+11 -4
View File
@@ -771,26 +771,33 @@ navigation_tree_branch.prototype.inject_into_dom = function (element, gntinstanc
if (this.myid != null) {
branchp.setAttribute('id',this.myid);
}
var branchicon = false;
if (this.myicon != null) {
var branchicon = document.createElement('img');
branchicon = document.createElement('img');
branchicon.setAttribute('src',this.myicon);
branchicon.setAttribute('alt','');
branchp.appendChild(branchicon);
this.myname = ' '+this.myname;
}
if (this.mylink === null) {
branchp.innerHTML = this.myname.replace(/\n/g, '<br />');
if (branchicon !== false) {
branchp.appendChild(branchicon);
}
branchp.appendChild(document.createTextNode(this.myname.replace(/\n/g, '<br />')));
} else {
var branchlink = document.createElement('a');
branchlink.setAttribute('title', this.mytitle);
branchlink.setAttribute('href', this.mylink);
branchlink.innerHTML = this.myname.replace(/\n/g, '<br />');
if (branchicon !== false) {
branchlink.appendChild(branchicon);
}
branchlink.appendChild(document.createTextNode(this.myname.replace(/\n/g, '<br />')));
if (this.myhidden) {
YAHOO.util.Dom.addClass(branchlink, 'dimmed');
}
branchp.appendChild(branchlink);
}
branchli.appendChild(branchp);
alert(branchli.innerHTML);
element.appendChild(branchli);
return branchli;
}