Commit 1598050f authored by Evan Prodromou's avatar Evan Prodromou

Show more menu items when you click More

I added the necessary JavaScript to show more menu items when you click More.
parent 1c917ac2
......@@ -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: {
......
This diff is collapsed.
......@@ -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'));
}
}
......@@ -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');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment