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
Kazuhiko Shiozaki
gitlab-ce
Commits
1a5992b5
Commit
1a5992b5
authored
Mar 14, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed breakpoint size
Changed breakpoint class into singleton
parent
23b0eeca
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
28 deletions
+34
-28
app/assets/javascripts/application.js.coffee
app/assets/javascripts/application.js.coffee
+3
-4
app/assets/javascripts/breakpoints.coffee
app/assets/javascripts/breakpoints.coffee
+26
-17
app/assets/javascripts/sidebar.js.coffee
app/assets/javascripts/sidebar.js.coffee
+1
-3
app/assets/stylesheets/framework/header.scss
app/assets/stylesheets/framework/header.scss
+2
-2
app/assets/stylesheets/framework/sidebar.scss
app/assets/stylesheets/framework/sidebar.scss
+2
-2
No files found.
app/assets/javascripts/application.js.coffee
View file @
1a5992b5
...
...
@@ -108,8 +108,7 @@ window.onload = ->
setTimeout
shiftWindow
,
100
$
->
breakpoints
=
new
Breakpoints
()
bootstrapBreakpoint
=
breakpoints
.
getBreakpointSize
()
bootstrapBreakpoint
=
bp
.
getBreakpointSize
()
$
(
".nicescroll"
).
niceScroll
(
cursoropacitymax
:
'0.4'
,
cursorcolor
:
'#FFF'
,
cursorborder
:
"1px solid #FFF"
)
...
...
@@ -261,12 +260,12 @@ $ ->
fitSidebarForSize
=
->
oldBootstrapBreakpoint
=
bootstrapBreakpoint
bootstrapBreakpoint
=
b
reakpoints
.
getBreakpointSize
()
bootstrapBreakpoint
=
b
p
.
getBreakpointSize
()
if
bootstrapBreakpoint
!=
oldBootstrapBreakpoint
$
(
document
).
trigger
(
'breakpoint:change'
,
[
bootstrapBreakpoint
])
checkInitialSidebarSize
=
->
bootstrapBreakpoint
=
b
reakpoints
.
getBreakpointSize
()
bootstrapBreakpoint
=
b
p
.
getBreakpointSize
()
if
bootstrapBreakpoint
is
"xs"
or
"sm"
$
(
document
).
trigger
(
'breakpoint:change'
,
[
bootstrapBreakpoint
])
...
...
app/assets/javascripts/breakpoints.coffee
View file @
1a5992b5
class
@
Breakpoints
instance
=
null
;
class
BreakpointInstance
BREAKPOINTS
=
[
"xs"
,
"sm"
,
"md"
,
"lg"
]
constructor
:
->
...
...
@@ -8,17 +11,23 @@ class @Breakpoints
allDeviceSelector
=
BREAKPOINTS
.
map
(
breakpoint
)
->
".device-
#{
breakpoint
}
"
if
$
(
allDeviceSelector
.
join
(
","
)).
length
return
return
if
$
(
allDeviceSelector
.
join
(
","
)).
length
# Create all the elements
$
.
each
BREAKPOINTS
,
(
i
,
breakpoint
)
->
$
(
"body"
).
append
"<div class='device-
#{
breakpoint
}
visible-
#{
breakpoint
}
'></div>"
getBreakpointSize
:
->
@
setup
()
allDeviceSelector
=
BREAKPOINTS
.
map
(
breakpoint
)
->
".device-
#{
breakpoint
}
"
$visibleDevice
=
$
(
allDeviceSelector
.
join
(
","
)).
filter
(
":visible"
)
return
$visibleDevice
.
attr
(
"class"
).
split
(
"visible-"
)[
1
]
@
get
:
->
return
instance
?=
new
BreakpointInstance
@
bp
=
Breakpoints
.
get
()
app/assets/javascripts/sidebar.js.coffee
View file @
1a5992b5
mobileWidth
=
991
collapsed
=
'page-sidebar-collapsed'
expanded
=
'page-sidebar-expanded'
...
...
@@ -21,8 +20,7 @@ $(document).on("click", '.toggle-nav-collapse', (e) ->
)
$
->
breakpoints
=
new
Breakpoints
()
size
=
breakpoints
.
getBreakpointSize
()
size
=
bp
.
getBreakpointSize
()
if
size
is
"xs"
or
size
is
"sm"
if
$
(
'.page-with-sidebar'
).
hasClass
(
expanded
)
...
...
app/assets/stylesheets/framework/header.scss
View file @
1a5992b5
...
...
@@ -144,7 +144,7 @@ header {
.header-collapsed
{
margin-left
:
$sidebar_collapsed_width
;
@media
(
min-width
:
$screen-
sm-max
)
{
@media
(
min-width
:
$screen-
md-min
)
{
@include
collapsed-header
;
}
}
...
...
@@ -152,7 +152,7 @@ header {
.header-expanded
{
margin-left
:
$sidebar_collapsed_width
;
@media
(
min-width
:
$screen-
sm-max
)
{
@media
(
min-width
:
$screen-
md-min
)
{
margin-left
:
$sidebar_width
;
}
}
...
...
app/assets/stylesheets/framework/sidebar.scss
View file @
1a5992b5
...
...
@@ -205,7 +205,7 @@
@mixin
expanded-sidebar
{
padding-left
:
$sidebar_collapsed_width
;
@media
(
min-width
:
$screen-
sm-max
)
{
@media
(
min-width
:
$screen-
md-min
)
{
padding-left
:
$sidebar_width
;
}
...
...
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