Show more menu items when you click More

I added the necessary JavaScript to show more menu items when you click More.
This commit is contained in:
Evan Prodromou 2011-07-07 10:26:07 -04:00
parent 1c917ac28f
commit 1598050f54
4 changed files with 24 additions and 5 deletions

View File

@ -1422,7 +1422,15 @@ var SN = { // StatusNet
SN.Init.NoticeFormSetup(form);
})
.find('.notice_data-text').focus();
}
},
showMoreMenuItems: function(menuid) {
$('#'+menuid+' .more_link').remove();
var selector = '#'+menuid+' .extended_menu';
var extended = $(selector);
extended.removeClass('extended_menu');
return void(0);
}
},
Init: {

2
js/util.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -80,5 +80,12 @@ class GroupsNav extends MoreMenu
return $items;
}
function seeAllItem() {
return array('usergroups',
array('nickname' => $this->user->nickname),
_('See all'),
_('See all groups you belong to'));
}
}

View File

@ -62,11 +62,13 @@ class MoreMenu extends Menu
{
$items = $this->getItems();
$tag = $this->tag();
$menuID = null;
$attrs = array('class' => 'nav');
if (!is_null($tag)) {
$attrs['id'] = 'nav_' . $tag;
$menuID = 'nav_' . $tag;
$attrs['id'] = $menuID;
}
if (Event::handle('StartNav', array($this, &$tag, &$items))) {
@ -87,8 +89,10 @@ class MoreMenu extends Menu
}
if ($total > self::SOFT_MAX + 1) {
$this->out->elementStart('li');
$this->out->element('a', array('href' => '#'),
$this->out->elementStart('li', array('class' => 'more_link'));
$this->out->element('a', array('href' => '#',
'onclick' => 'SN.U.showMoreMenuItems("'.$menuID.'"); return false;'),
_('More ▼'));
$this->out->elementEnd('li');