From 8d24baad94ce2b358d62e6ebb57296192b90af04 Mon Sep 17 00:00:00 2001 From: Crack Date: Sun, 25 Jul 2010 22:58:52 +0200 Subject: [PATCH] run submenu code only when #topmenu is present todo update --- .gsoc/todo.txt | 7 +++++++ js/functions.js | 8 ++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.gsoc/todo.txt b/.gsoc/todo.txt index 259072de9..b9a860860 100644 --- a/.gsoc/todo.txt +++ b/.gsoc/todo.txt @@ -1,2 +1,9 @@ restore cache'ing in phpmyadmin.css.php remove debug from user preferences header + +marker for extension dependent options (SOAP for sql validation) + +info about setup script in prefs manage, it seems many people still don't know it exists +(and maybe some description in docs on making it work with live configuration?) + +info for constrained values (eg. MaxDbList)? diff --git a/js/functions.js b/js/functions.js index 5ae2b6050..73910e348 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1795,6 +1795,10 @@ function menuResize() } $(function() { + var topmenu = $('#topmenu'); + if (topmenu.length == 0) { + return; + } // create submenu container var link = $('') .attr({href: '#', 'class': 'tab'}) @@ -1802,7 +1806,7 @@ $(function() { .click(function(e) { e.preventDefault(); }); - var img = $('#topmenucontainer li:first-child').find('img'); + var img = topmenu.find('li:first-child').find('img'); if (img.length) { img = img.clone(); img.attr('src', img.attr('src').replace(/\/[^\/]+$/, '/b_more.png')).prependTo(link); @@ -1822,7 +1826,7 @@ $(function() { } }) .hide(); - $('#topmenu').append(submenu); + topmenu.append(submenu); // populate submenu and register resize event $(window).resize(menuResize);