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
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
Hide 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 = ->
...
@@ -108,8 +108,7 @@ window.onload = ->
setTimeout
shiftWindow
,
100
setTimeout
shiftWindow
,
100
$
->
$
->
breakpoints
=
new
Breakpoints
()
bootstrapBreakpoint
=
bp
.
getBreakpointSize
()
bootstrapBreakpoint
=
breakpoints
.
getBreakpointSize
()
$
(
".nicescroll"
).
niceScroll
(
cursoropacitymax
:
'0.4'
,
cursorcolor
:
'#FFF'
,
cursorborder
:
"1px solid #FFF"
)
$
(
".nicescroll"
).
niceScroll
(
cursoropacitymax
:
'0.4'
,
cursorcolor
:
'#FFF'
,
cursorborder
:
"1px solid #FFF"
)
...
@@ -261,12 +260,12 @@ $ ->
...
@@ -261,12 +260,12 @@ $ ->
fitSidebarForSize
=
->
fitSidebarForSize
=
->
oldBootstrapBreakpoint
=
bootstrapBreakpoint
oldBootstrapBreakpoint
=
bootstrapBreakpoint
bootstrapBreakpoint
=
b
reakpoints
.
getBreakpointSize
()
bootstrapBreakpoint
=
b
p
.
getBreakpointSize
()
if
bootstrapBreakpoint
!=
oldBootstrapBreakpoint
if
bootstrapBreakpoint
!=
oldBootstrapBreakpoint
$
(
document
).
trigger
(
'breakpoint:change'
,
[
bootstrapBreakpoint
])
$
(
document
).
trigger
(
'breakpoint:change'
,
[
bootstrapBreakpoint
])
checkInitialSidebarSize
=
->
checkInitialSidebarSize
=
->
bootstrapBreakpoint
=
b
reakpoints
.
getBreakpointSize
()
bootstrapBreakpoint
=
b
p
.
getBreakpointSize
()
if
bootstrapBreakpoint
is
"xs"
or
"sm"
if
bootstrapBreakpoint
is
"xs"
or
"sm"
$
(
document
).
trigger
(
'breakpoint:change'
,
[
bootstrapBreakpoint
])
$
(
document
).
trigger
(
'breakpoint:change'
,
[
bootstrapBreakpoint
])
...
...
app/assets/javascripts/breakpoints.coffee
View file @
1a5992b5
class
@
Breakpoints
class
@
Breakpoints
BREAKPOINTS
=
[
"xs"
,
"sm"
,
"md"
,
"lg"
]
instance
=
null
;
c
onstructor
:
->
c
lass
BreakpointInstance
@
setup
()
BREAKPOINTS
=
[
"xs"
,
"sm"
,
"md"
,
"lg"
]
setup
:
->
constructor
:
->
allDeviceSelector
=
BREAKPOINTS
.
map
(
breakpoint
)
->
@
setup
()
".device-
#{
breakpoint
}
"
if
$
(
allDeviceSelector
.
join
(
","
)).
length
setup
:
->
return
allDeviceSelector
=
BREAKPOINTS
.
map
(
breakpoint
)
->
".device-
#{
breakpoint
}
"
# Create all the elements
return
if
$
(
allDeviceSelector
.
join
(
","
)).
length
$
.
each
BREAKPOINTS
,
(
i
,
breakpoint
)
->
$
(
"body"
).
append
"<div class='device-
#{
breakpoint
}
visible-
#{
breakpoint
}
'></div>"
getBreakpointSize
:
->
# Create all the elements
allDeviceSelector
=
BREAKPOINTS
.
map
(
breakpoint
)
->
$
.
each
BREAKPOINTS
,
(
i
,
breakpoint
)
->
".device-
#{
breakpoint
}
"
$
(
"body"
).
append
"<div class='device-
#{
breakpoint
}
visible-
#{
breakpoint
}
'></div>
"
$visibleDevice
=
$
(
allDeviceSelector
.
join
(
","
)).
filter
(
":visible"
)
getBreakpointSize
:
->
@
setup
()
return
$visibleDevice
.
attr
(
"class"
).
split
(
"visible-"
)[
1
]
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'
collapsed
=
'page-sidebar-collapsed'
expanded
=
'page-sidebar-expanded'
expanded
=
'page-sidebar-expanded'
...
@@ -21,8 +20,7 @@ $(document).on("click", '.toggle-nav-collapse', (e) ->
...
@@ -21,8 +20,7 @@ $(document).on("click", '.toggle-nav-collapse', (e) ->
)
)
$
->
$
->
breakpoints
=
new
Breakpoints
()
size
=
bp
.
getBreakpointSize
()
size
=
breakpoints
.
getBreakpointSize
()
if
size
is
"xs"
or
size
is
"sm"
if
size
is
"xs"
or
size
is
"sm"
if
$
(
'.page-with-sidebar'
).
hasClass
(
expanded
)
if
$
(
'.page-with-sidebar'
).
hasClass
(
expanded
)
...
...
app/assets/stylesheets/framework/header.scss
View file @
1a5992b5
...
@@ -144,7 +144,7 @@ header {
...
@@ -144,7 +144,7 @@ header {
.header-collapsed
{
.header-collapsed
{
margin-left
:
$sidebar_collapsed_width
;
margin-left
:
$sidebar_collapsed_width
;
@media
(
min-width
:
$screen-
sm-max
)
{
@media
(
min-width
:
$screen-
md-min
)
{
@include
collapsed-header
;
@include
collapsed-header
;
}
}
}
}
...
@@ -152,7 +152,7 @@ header {
...
@@ -152,7 +152,7 @@ header {
.header-expanded
{
.header-expanded
{
margin-left
:
$sidebar_collapsed_width
;
margin-left
:
$sidebar_collapsed_width
;
@media
(
min-width
:
$screen-
sm-max
)
{
@media
(
min-width
:
$screen-
md-min
)
{
margin-left
:
$sidebar_width
;
margin-left
:
$sidebar_width
;
}
}
}
}
...
...
app/assets/stylesheets/framework/sidebar.scss
View file @
1a5992b5
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
@media
(
min-width
:
$screen-sm-min
)
{
@media
(
min-width
:
$screen-sm-min
)
{
padding-right
:
$gutter_width
;
padding-right
:
$gutter_width
;
}
}
}
}
}
}
...
@@ -205,7 +205,7 @@
...
@@ -205,7 +205,7 @@
@mixin
expanded-sidebar
{
@mixin
expanded-sidebar
{
padding-left
:
$sidebar_collapsed_width
;
padding-left
:
$sidebar_collapsed_width
;
@media
(
min-width
:
$screen-
sm-max
)
{
@media
(
min-width
:
$screen-
md-min
)
{
padding-left
:
$sidebar_width
;
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