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
Boxiang Sun
gitlab-ce
Commits
9db02e5b
Commit
9db02e5b
authored
Apr 21, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move event handlers to methods
parent
5c10b297
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
app/assets/javascripts/right_sidebar.js.coffee
app/assets/javascripts/right_sidebar.js.coffee
+14
-10
No files found.
app/assets/javascripts/right_sidebar.js.coffee
View file @
9db02e5b
...
...
@@ -5,16 +5,8 @@ class @Sidebar
@
addEventListeners
()
addEventListeners
:
->
_this
=
@
@
sidebar
.
on
'click'
,
'.sidebar-collapsed-icon'
,
(
e
)
->
e
.
preventDefault
()
$block
=
$
(
@
).
closest
(
'.block'
)
_this
.
openDropdown
(
$block
);
$
(
'.dropdown'
).
on
'hidden.gl.dropdown'
,
(
e
)
->
e
.
preventDefault
()
$block
=
$
(
@
).
closest
(
'.block'
)
_this
.
sidebarDropdownHidden
(
$block
)
@
sidebar
.
on
(
'click'
,
'.sidebar-collapsed-icon'
,
@
,
@
sidebarCollapseClicked
)
$
(
'.dropdown'
).
on
(
'hidden.gl.dropdown'
,
@
,
@
onSidebarDropdownHidden
)
$
(
'.dropdown'
).
on
(
'loading.gl.dropdown'
,
@
sidebarDropdownLoading
)
$
(
'.dropdown'
).
on
(
'loaded.gl.dropdown'
,
@
sidebarDropdownLoaded
)
...
...
@@ -40,6 +32,12 @@ class @Sidebar
else
i
.
show
()
sidebarCollapseClicked
:
(
e
)
->
sidebar
=
e
.
data
e
.
preventDefault
()
$block
=
$
(
@
).
closest
(
'.block'
)
sidebar
.
openDropdown
(
$block
);
openDropdown
:
(
blockOrName
)
->
$block
=
if
_
.
isString
(
blockOrName
)
then
@
getBlock
(
blockOrName
)
else
blockOrName
...
...
@@ -53,6 +51,12 @@ class @Sidebar
$block
.
addClass
(
'collapse-after-update'
)
$
(
'.page-with-sidebar'
).
addClass
(
'with-overlay'
)
onSidebarDropdownHidden
:
(
e
)
->
sidebar
=
e
.
data
e
.
preventDefault
()
$block
=
$
(
@
).
closest
(
'.block'
)
sidebar
.
sidebarDropdownHidden
(
$block
)
sidebarDropdownHidden
:
(
$block
)
->
if
$block
.
hasClass
(
'collapse-after-update'
)
$block
.
removeClass
(
'collapse-after-update'
)
...
...
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