Change More hiding/showing to CSS class from explicit block/none.

When theme wants to use something else than display: block; the old
method did not work.
This commit is contained in:
Michal Čihař
2011-02-02 23:14:52 +01:00
parent d296a5222b
commit 48d3e6850a
3 changed files with 11 additions and 4 deletions

View File

@@ -2297,7 +2297,7 @@ function menuResize()
for (var i = hide_start; i < li.length-1; i++) { for (var i = hide_start; i < li.length-1; i++) {
$(li[i])[more_shown ? 'prependTo' : 'appendTo'](submenu_ul); $(li[i])[more_shown ? 'prependTo' : 'appendTo'](submenu_ul);
} }
submenu.show(); submenu.addClass('shown');
} else if (more_shown) { } else if (more_shown) {
w -= submenu_w; w -= submenu_w;
// nothing hidden, maybe something can be restored // nothing hidden, maybe something can be restored
@@ -2308,7 +2308,7 @@ function menuResize()
if (w+submenu_w < wmax || (i == li2.length-1 && w < wmax)) { if (w+submenu_w < wmax || (i == li2.length-1 && w < wmax)) {
$(li2[i]).insertBefore(submenu); $(li2[i]).insertBefore(submenu);
if (i == li2.length-1) { if (i == li2.length-1) {
submenu.hide(); submenu.removeClass('shown');
} }
continue; continue;
} }
@@ -2349,8 +2349,7 @@ $(function() {
if ($(this).find('ul .tabactive').length == 0) { if ($(this).find('ul .tabactive').length == 0) {
$(this).removeClass('submenuhover').find('> a').removeClass('tabactive'); $(this).removeClass('submenuhover').find('> a').removeClass('tabactive');
} }
}) });
.hide();
topmenu.append(submenu); topmenu.append(submenu);
// populate submenu and register resize event // populate submenu and register resize event

View File

@@ -692,6 +692,10 @@ ul#topmenu ul a {
ul#topmenu .submenu { ul#topmenu .submenu {
position: relative; position: relative;
display: none;
}
ul#topmenu .shown {
display: block;
} }
ul#topmenu ul { ul#topmenu ul {

View File

@@ -667,6 +667,10 @@ ul#topmenu ul a {
ul#topmenu .submenu { ul#topmenu .submenu {
position: relative; position: relative;
display: none;
}
ul#topmenu .shown {
display: block;
} }
ul#topmenu ul { ul#topmenu ul {