Skip to content

Commit

Permalink
clicking on subsections in the menu goes to the first slide
Browse files Browse the repository at this point in the history
  • Loading branch information
schacon committed Jan 26, 2010
1 parent 39c8958 commit 253783b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions public/js/showoff.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,16 +208,17 @@ function keyDown(event)
}


function ListMenu()
function ListMenu(s)
{
this.slide = s
this.typeName = 'ListMenu'
this.itemLength = 0;
this.items = new Array();
this.addItem = function (key, text, slide) {
if (key.length > 1) {
thisKey = key.shift()
if (!this.items[thisKey]) {
this.items[thisKey] = new ListMenu
this.items[thisKey] = new ListMenu(slide)
}
this.items[thisKey].addItem(key, text, slide)
} else {
Expand All @@ -231,7 +232,7 @@ function ListMenu()
var item = this.items[i]
var domItem = $("<li>")
if (item.typeName == 'ListMenu') {
choice = $("<a href=\"#\">" + i + "</a>")
choice = $("<a rel=\"" + (item.slide - 1) + "\" href=\"#\">" + i + "</a>")
domItem.append(choice)
domItem.append(item.getList())
}
Expand Down

0 comments on commit 253783b

Please sign in to comment.