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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
ef10484f
Commit
ef10484f
authored
Mar 06, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Epics Sidebar Context
parent
e6a8ac89
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
ee/app/assets/javascripts/epics/epic_show/sidebar_context.js
ee/app/assets/javascripts/epics/epic_show/sidebar_context.js
+40
-0
No files found.
ee/app/assets/javascripts/epics/epic_show/sidebar_context.js
0 → 100644
View file @
ef10484f
import
Mousetrap
from
'
mousetrap
'
;
export
default
class
SidebarContext
{
constructor
()
{
const
$issuableSidebar
=
$
(
'
.js-issuable-update
'
);
Mousetrap
.
bind
(
'
l
'
,
()
=>
SidebarContext
.
openSidebarDropdown
(
$issuableSidebar
.
find
(
'
.js-labels-block
'
)));
$issuableSidebar
.
off
(
'
click
'
,
'
.js-sidebar-dropdown-toggle
'
)
.
on
(
'
click
'
,
'
.js-sidebar-dropdown-toggle
'
,
function
onClickEdit
(
e
)
{
e
.
preventDefault
();
const
$block
=
$
(
this
).
parents
(
'
.js-labels-block
'
);
const
$selectbox
=
$block
.
find
(
'
.js-selectbox
'
);
// We use `:visible` to detect element visibility
// since labels dropdown itself is handled by
// labels_select.js which internally uses
// $.hide() & $.show() to toggle elements
// which requires us to use `display: none;`
// in `labels_select/base.vue` as well.
// see: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/4773#note_61844731
if
(
$selectbox
.
is
(
'
:visible
'
))
{
$selectbox
.
hide
();
$block
.
find
(
'
.js-value
'
).
show
();
}
else
{
$selectbox
.
show
();
$block
.
find
(
'
.js-value
'
).
hide
();
}
if
(
$selectbox
.
is
(
'
:visible
'
))
{
setTimeout
(()
=>
$block
.
find
(
'
.js-label-select
'
).
trigger
(
'
click
'
),
0
);
}
});
}
static
openSidebarDropdown
(
$block
)
{
$block
.
find
(
'
.js-sidebar-dropdown-toggle
'
).
trigger
(
'
click
'
);
}
}
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