Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
e164447b
Commit
e164447b
authored
May 03, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Emit `toggleSidebar` event on component when icon is clicked
parent
342fbbda
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
app/assets/javascripts/sidebar/components/participants/participants.vue
...ascripts/sidebar/components/participants/participants.vue
+4
-0
spec/javascripts/sidebar/participants_spec.js
spec/javascripts/sidebar/participants_spec.js
+14
-0
No files found.
app/assets/javascripts/sidebar/components/participants/participants.vue
View file @
e164447b
...
@@ -70,6 +70,9 @@
...
@@ -70,6 +70,9 @@
toggleMoreParticipants
()
{
toggleMoreParticipants
()
{
this
.
isShowingMoreParticipants
=
!
this
.
isShowingMoreParticipants
;
this
.
isShowingMoreParticipants
=
!
this
.
isShowingMoreParticipants
;
},
},
onClickCollapsedIcon
()
{
this
.
$emit
(
'
toggleSidebar
'
);
},
},
},
};
};
</
script
>
</
script
>
...
@@ -82,6 +85,7 @@
...
@@ -82,6 +85,7 @@
data-container=
"body"
data-container=
"body"
data-placement=
"left"
data-placement=
"left"
:title=
"participantLabel"
:title=
"participantLabel"
@
click=
"onClickCollapsedIcon"
>
>
<i
<i
class=
"fa fa-users"
class=
"fa fa-users"
...
...
spec/javascripts/sidebar/participants_spec.js
View file @
e164447b
...
@@ -170,5 +170,19 @@ describe('Participants', function () {
...
@@ -170,5 +170,19 @@ describe('Participants', function () {
expect
(
vm
.
isShowingMoreParticipants
).
toBe
(
true
);
expect
(
vm
.
isShowingMoreParticipants
).
toBe
(
true
);
});
});
it
(
'
clicking on participants icon emits `toggleSidebar` event
'
,
()
=>
{
vm
=
mountComponent
(
Participants
,
{
loading
:
false
,
participants
:
PARTICIPANT_LIST
,
numberOfLessParticipants
:
2
,
});
spyOn
(
vm
,
'
$emit
'
);
const
participantsIconEl
=
vm
.
$el
.
querySelector
(
'
.sidebar-collapsed-icon
'
);
participantsIconEl
.
click
();
expect
(
vm
.
$emit
).
toHaveBeenCalledWith
(
'
toggleSidebar
'
);
});
});
});
});
});
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