Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Admit groupPageText false #26

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions jquery.mobilemenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,19 @@

//function to create options in the select menu
function createOption($item, $container, text){
// check for valid href attribute
var href = var href = $item.find('a:first').attr('href');
if (!href) {
href = '#';
}

//if no text param is passed, use list item's text, otherwise use settings.groupPageText
if(!text){
$('<option value="' + href + '">'+$.trim(getText($item))+'</option>').appendTo($container);
} else {
$('<option value="' + href + '">'+text+'</option>').appendTo($container);
}

//if no text param is passed, use list item's text, otherwise use settings.groupPageText
if(!text){
$('<option value="'+$item.find('a:first').attr('href')+'">'+$.trim(getText($item))+'</option>').appendTo($container);
} else {
$('<option value="'+$item.find('a:first').attr('href')+'">'+text+'</option>').appendTo($container);
}

}//createOption()


Expand All @@ -148,7 +153,9 @@
var $optgroup = $('<optgroup label="'+$.trim(getText($group))+'" />');

//append top option to it (current list item's text)
createOption($group,$optgroup, settings.groupPageText);
if (settings.groupPageText != false) {
createOption($group, $optgroup, settings.groupPageText);
}

//loop through each sub-nav list
$group.children('ul, ol').each(function(){
Expand Down