menu fix
This commit is contained in:
@@ -115,7 +115,7 @@ function make_menu() {
|
|||||||
var sel=document.createElement("select");
|
var sel=document.createElement("select");
|
||||||
sel.onchange=function(){
|
sel.onchange=function(){
|
||||||
if (this.value=="") { return }
|
if (this.value=="") { return }
|
||||||
document.getElementById("anchor_"+this.value).scrollIntoView();
|
document.getElementById(this.value).scrollIntoView();
|
||||||
document.getElementById("menu").value="";
|
document.getElementById("menu").value="";
|
||||||
};
|
};
|
||||||
sel.id="menu";
|
sel.id="menu";
|
||||||
@@ -124,13 +124,15 @@ function make_menu() {
|
|||||||
opt.value="";
|
opt.value="";
|
||||||
opt.innerHTML="#";
|
opt.innerHTML="#";
|
||||||
sel.appendChild(opt);
|
sel.appendChild(opt);
|
||||||
|
var anchor_index = 0;
|
||||||
for (c=0; c<linkList.length; c++) {
|
for (c=0; c<linkList.length; c++) {
|
||||||
if ( linkList[c].substring(0,2) == "# " ) {
|
if ( linkList[c].substring(0,2) == "# " ) {
|
||||||
var opt=document.createElement("option");
|
var opt=document.createElement("option");
|
||||||
var name=linkList[c].substring(1).trim().replace(/ /g,"");
|
var name=linkList[c].substring(1).trim().replace(/ /g,"");
|
||||||
opt.innerHTML=linkList[c].trim();
|
opt.innerHTML=linkList[c].trim();
|
||||||
opt.value=name.replace(/^#/,"");
|
opt.value="anchor_" + name.replace(/^#/,"") + "_" + anchor_index;
|
||||||
sel.appendChild(opt);
|
sel.appendChild(opt);
|
||||||
|
anchor_index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user