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
Tatuya Kamada
gitlab-ce
Commits
3cf9b772
Commit
3cf9b772
authored
Jun 21, 2016
by
Fatih Acet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jQuery selector refactor in application.js.
parent
5804b6a0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
14 deletions
+19
-14
app/assets/javascripts/application.js.coffee
app/assets/javascripts/application.js.coffee
+19
-14
No files found.
app/assets/javascripts/application.js.coffee
View file @
3cf9b772
...
...
@@ -121,6 +121,11 @@ window.onload = ->
setTimeout
shiftWindow
,
100
$
->
$document
=
$
(
document
)
$window
=
$
(
window
)
$body
=
$
(
'body'
)
gl
.
utils
.
preventDisabledButtons
()
bootstrapBreakpoint
=
bp
.
getBreakpointSize
()
...
...
@@ -152,7 +157,7 @@ $ ->
),
1
# Initialize tooltips
$
(
'body'
)
.
tooltip
(
$
body
.
tooltip
(
selector
:
'.has-tooltip, [data-toggle="tooltip"]'
placement
:
(
_
,
el
)
->
$el
=
$
(
el
)
...
...
@@ -171,7 +176,7 @@ $ ->
flash
.
show
()
# Disable form buttons while a form is submitting
$
(
'body'
)
.
on
'ajax:complete, ajax:beforeSend, submit'
,
'form'
,
(
e
)
->
$
body
.
on
'ajax:complete, ajax:beforeSend, submit'
,
'form'
,
(
e
)
->
buttons
=
$
(
'[type="submit"]'
,
@
)
switch
e
.
type
...
...
@@ -184,7 +189,7 @@ $ ->
$
(
'.account-box'
).
hover
->
$
(
@
).
toggleClass
(
'hover'
)
# Commit show suppressed diff
$
(
document
)
.
on
'click'
,
'.diff-content .js-show-suppressed-diff'
,
->
$
document
.
on
'click'
,
'.diff-content .js-show-suppressed-diff'
,
->
$container
=
$
(
@
).
parent
()
$container
.
next
(
'table'
).
show
()
$container
.
remove
()
...
...
@@ -197,13 +202,13 @@ $ ->
$
(
'.navbar-toggle i'
).
toggleClass
(
"fa-angle-right fa-angle-left"
)
# Show/hide comments on diff
$
(
"body"
)
.
on
"click"
,
".js-toggle-diff-comments"
,
(
e
)
->
$
body
.
on
"click"
,
".js-toggle-diff-comments"
,
(
e
)
->
$
(
@
).
toggleClass
(
'active'
)
$
(
@
).
closest
(
".diff-file"
).
find
(
".notes_holder"
).
toggle
()
e
.
preventDefault
()
$
(
document
)
.
off
"click"
,
'.js-confirm-danger'
$
(
document
)
.
on
"click"
,
'.js-confirm-danger'
,
(
e
)
->
$
document
.
off
"click"
,
'.js-confirm-danger'
$
document
.
on
"click"
,
'.js-confirm-danger'
,
(
e
)
->
e
.
preventDefault
()
btn
=
$
(
e
.
target
)
text
=
btn
.
data
(
"confirm-danger-message"
)
...
...
@@ -211,7 +216,7 @@ $ ->
new
ConfirmDangerModal
(
form
,
text
)
$
(
document
)
.
on
'click'
,
'button'
,
->
$
document
.
on
'click'
,
'button'
,
->
$
(
this
).
blur
()
$
(
'input[type="search"]'
).
each
->
...
...
@@ -219,7 +224,7 @@ $ ->
$this
.
attr
'value'
,
$this
.
val
()
return
$
(
document
)
$
document
.
off
'keyup'
,
'input[type="search"]'
.
on
'keyup'
,
'input[type="search"]'
,
(
e
)
->
$this
=
$
(
this
)
...
...
@@ -227,7 +232,7 @@ $ ->
$sidebarGutterToggle
=
$
(
'.js-sidebar-toggle'
)
$
(
document
)
$
document
.
off
'breakpoint:change'
.
on
'breakpoint:change'
,
(
e
,
breakpoint
)
->
if
breakpoint
is
'sm'
or
breakpoint
is
'xs'
...
...
@@ -239,14 +244,14 @@ $ ->
oldBootstrapBreakpoint
=
bootstrapBreakpoint
bootstrapBreakpoint
=
bp
.
getBreakpointSize
()
if
bootstrapBreakpoint
!=
oldBootstrapBreakpoint
$
(
document
)
.
trigger
(
'breakpoint:change'
,
[
bootstrapBreakpoint
])
$
document
.
trigger
(
'breakpoint:change'
,
[
bootstrapBreakpoint
])
checkInitialSidebarSize
=
->
bootstrapBreakpoint
=
bp
.
getBreakpointSize
()
if
bootstrapBreakpoint
is
"xs"
or
"sm"
$
(
document
)
.
trigger
(
'breakpoint:change'
,
[
bootstrapBreakpoint
])
$
document
.
trigger
(
'breakpoint:change'
,
[
bootstrapBreakpoint
])
$
(
window
)
$
window
.
off
"resize.app"
.
on
"resize.app"
,
(
e
)
->
fitSidebarForSize
()
...
...
@@ -256,14 +261,14 @@ $ ->
new
Aside
()
# Sidenav pinning
if
$
(
window
)
.
width
()
<
1440
and
$
.
cookie
(
'pin_nav'
)
is
'true'
if
$
window
.
width
()
<
1440
and
$
.
cookie
(
'pin_nav'
)
is
'true'
$
.
cookie
(
'pin_nav'
,
'false'
,
{
path
:
'/'
})
$
(
'.page-with-sidebar'
)
.
toggleClass
(
'page-sidebar-collapsed page-sidebar-expanded'
)
.
removeClass
(
'page-sidebar-pinned'
)
$
(
'.navbar-fixed-top'
).
removeClass
(
'header-pinned-nav'
)
$
(
document
)
$
document
.
off
'click'
,
'.js-nav-pin'
.
on
'click'
,
'.js-nav-pin'
,
(
e
)
->
e
.
preventDefault
()
...
...
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