mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-02-03 21:19:18 +01:00
feat(core): dropdown menu item default event
This commit is contained in:
@@ -47,11 +47,17 @@
|
||||
});
|
||||
|
||||
//set menu bar opened when hover
|
||||
$('div.navbar-mt ul.nav li.dropdown').hover(function () {
|
||||
$('div.navbar-mt ul.nav li.dropdown').hover(function (evt) {
|
||||
if (!$(this).hasClass('open')) {
|
||||
$(this).find('.dropdown-toggle', this).trigger('click');
|
||||
$(this).bind('click', function (e) {
|
||||
var sta = $(this).find('.dropdown-toggle', this).attr('alt');
|
||||
if (sta)
|
||||
$state.go(sta);
|
||||
});
|
||||
}
|
||||
}, function () {
|
||||
}, function (evt) {
|
||||
$(this).unbind('click');
|
||||
if ($(this).hasClass('open')) {
|
||||
$(this).find('.dropdown-toggle', this).trigger('click');
|
||||
}
|
||||
|
||||
@@ -61,7 +61,8 @@
|
||||
target: options.target || undefined,
|
||||
divider: options.divider || false,
|
||||
faClass: options.faClass || null,
|
||||
faIcon: options.faIcon || null
|
||||
faIcon: options.faIcon || null,
|
||||
linkState: options.linkState || undefined
|
||||
});
|
||||
|
||||
// Add submenu items
|
||||
@@ -96,7 +97,8 @@
|
||||
target: options.target || undefined,
|
||||
divider: options.divider || false,
|
||||
faClass: options.faClass || null,
|
||||
faIcon: options.faIcon || null
|
||||
faIcon: options.faIcon || null,
|
||||
linkState: options.linkState || undefined
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<li ng-repeat="item in vm.menu.items | orderBy: 'position'" ng-if="item.shouldRender(vm.authentication.user);" ng-switch="item.type"
|
||||
ng-class="{ dropdown: item.type === 'dropdown' }" ui-sref-active="active" class="{{item.class}}"
|
||||
uib-dropdown="item.type === 'dropdown'">
|
||||
<a ng-switch-when="dropdown" class="dropdown-toggle" uib-dropdown-toggle role="button"><span
|
||||
<a ng-switch-when="dropdown" class="dropdown-toggle" uib-dropdown-toggle role="button" alt="{{item.linkState}}"><span
|
||||
menu-title="{{item.title}}">{{::item.title}}</span> <span class="caret"></span></a>
|
||||
<ul ng-switch-when="dropdown" class="dropdown-menu">
|
||||
<li ui-sref-active="active" ng-repeat="subitem in item.items | orderBy: 'position'"
|
||||
@@ -48,7 +48,7 @@
|
||||
{{'TABLE_FIELDS.LEECHED' | translate}}: {{vm.authentication.user.leeched}}</span>
|
||||
</li>
|
||||
<li class="dropdown" uib-dropdown>
|
||||
<a class="dropdown-toggle user-header-dropdown-toggle" uib-dropdown-toggle role="button">
|
||||
<a class="dropdown-toggle user-header-dropdown-toggle" uib-dropdown-toggle role="button" alt="status.account">
|
||||
<img ng-src="{{vm.authentication.user.profileImageURL}}" alt="{{vm.authentication.user.displayName}}"
|
||||
class="header-profile-image"/>
|
||||
<span class="sm-hide" ng-bind="vm.authentication.user.displayName"></span> <b class="caret"></b>
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
menuService.addMenuItem('topbar', {
|
||||
title: 'MENU_TORRENTS',
|
||||
state: 'torrents',
|
||||
linkState: 'torrents.aggregate',
|
||||
type: 'dropdown',
|
||||
roles: ['*'],
|
||||
position: 0
|
||||
|
||||
Reference in New Issue
Block a user