From 0b03860a155d8d56ea0d4a7ecf6f9930f8f539f0 Mon Sep 17 00:00:00 2001 From: Antonino Caccamo Date: Wed, 12 Dec 2012 10:04:15 +0100 Subject: [PATCH 1/2] Update jquery.mobilemenu.js When groupPageText is fale do not include the dummy option for the optgroup --- jquery.mobilemenu.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jquery.mobilemenu.js b/jquery.mobilemenu.js index e51925a..30316ef 100644 --- a/jquery.mobilemenu.js +++ b/jquery.mobilemenu.js @@ -148,7 +148,9 @@ var $optgroup = $(''); //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(){ From ef3bab62167e68530fedb7764aab58b3111fcc36 Mon Sep 17 00:00:00 2001 From: Antonino Caccamo Date: Wed, 12 Dec 2012 10:34:32 +0100 Subject: [PATCH 2/2] Update jquery.mobilemenu.js On createOption check for valid href attribute, otherwise put a # --- jquery.mobilemenu.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/jquery.mobilemenu.js b/jquery.mobilemenu.js index 30316ef..d9d52a8 100644 --- a/jquery.mobilemenu.js +++ b/jquery.mobilemenu.js @@ -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){ + $('').appendTo($container); + } else { + $('').appendTo($container); + } - //if no text param is passed, use list item's text, otherwise use settings.groupPageText - if(!text){ - $('').appendTo($container); - } else { - $('').appendTo($container); - } - }//createOption()