Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
dfcb10be
Commit
dfcb10be
authored
Nov 02, 2018
by
Hannah Stepanek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add showGroupsMenu to group list controller
Use showGroupsMenu to decide when to show drop down
parent
c5488135
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
3 deletions
+23
-3
group-list.js
src/sidebar/components/group-list.js
+4
-0
group-list.html
src/sidebar/templates/group-list.html
+19
-3
No files found.
src/sidebar/components/group-list.js
View file @
dfcb10be
...
...
@@ -75,6 +75,10 @@ function GroupListController($window, analytics, groups, settings, serviceUrl) {
}
this
.
isThirdPartyService
=
isThirdPartyService
(
settings
);
this
.
showGroupsMenu
=
()
=>
{
return
!
(
this
.
isThirdPartyService
&&
(
this
.
groups
.
all
().
length
<=
1
)
);
};
}
module
.
exports
=
{
...
...
src/sidebar/templates/group-list.html
View file @
dfcb10be
<div
class=
"pull-right"
dropdown
keyboard-nav
>
<!-- Show a drop down menu if showGroupsMenu is true. -->
<div
class=
"dropdown-toggle"
dropdown-toggle
data-toggle=
"dropdown"
role=
"button"
title=
"Change the selected group"
>
title=
"Change the selected group"
ng-if=
"vm.showGroupsMenu()"
>
<img
class=
"group-list-label__icon group-list-label__icon--organization"
ng-src=
"{{ vm.focusedIcon() }}"
alt=
"{{ vm.orgName(vm.groups.focused().id)}}"
...
...
@@ -15,8 +16,23 @@
!-->
<span
class=
"group-list-label__label"
>
{{vm.groups.focused().name}}
</span>
<!-- nospace
!-->
<i
class=
"h-icon-arrow-drop-down"
></i>
</div>
<div
class=
"dropdown-menu__top-arrow"
></div>
<ul
class=
"dropdown-menu pull-none"
role=
"menu"
>
<!-- Do not show a drop down menu if showGroupsMenu is false. -->
<div
class=
"dropdown-toggle"
dropdown-toggle
role=
"header"
aria-level=
"2"
title=
"Selected group"
ng-if=
"!vm.showGroupsMenu()"
>
<img
class=
"group-list-label__icon group-list-label__icon--organization"
ng-src=
"{{ vm.focusedIcon() }}"
alt=
"{{ vm.orgName(vm.groups.focused().id)}}"
ng-if=
"vm.focusedIcon()"
>
<i
class=
"group-list-label__icon h-icon-{{ vm.focusedIconClass() }}"
ng-if=
"!vm.focusedIcon()"
></i>
<!-- nospace
!-->
<span
class=
"group-list-label__label"
>
{{vm.groups.focused().name}}
</span>
</div>
<!-- Only build the drop down menu if showGroupsMenu is true. -->
<div
class=
"dropdown-menu__top-arrow"
ng-if=
"vm.showGroupsMenu()"
></div>
<ul
class=
"dropdown-menu pull-none"
role=
"menu"
ng-if=
"vm.showGroupsMenu()"
>
<li
class=
"dropdown-menu__row dropdown-menu__row--unpadded "
ng-repeat=
"group in vm.groupOrganizations() track by group.id"
>
<div
ng-class=
"{'group-item': true, selected: group.id == vm.groups.focused().id}"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment