Skip to content

Commit

Permalink
change the code to get indented childs in <select>.
Browse files Browse the repository at this point in the history
Example:
Item
Item
- Child
-- Second Child
Item

Insted of:
Item
Item
Child
Second Child
Item
  • Loading branch information
nicoandrade committed Jul 12, 2012
1 parent fcdefb7 commit 8679588
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tinynav.js
Original file line number Diff line number Diff line change
@@ -35,10 +35,11 @@
.addClass('l_' + namespace_i)
.find('a')
.each(function () {
options +=
'<option value="' + $(this).attr('href') + '">' +
$(this).text() +
'</option>';
options += '<option value="' + $(this).attr('href') + '">';
for (j = 0; j < $(this).parents('ul, ol').length - 1; j++) {
options += '- ';
}
options += $(this).text() + '</option>';
});

// Append options into a select

0 comments on commit 8679588

Please sign in to comment.