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
iv
gitlab-ce
Commits
29130f37
Commit
29130f37
authored
Jun 13, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hides the fade right unless required
parent
5e955d2c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
14 deletions
+31
-14
app/assets/javascripts/layout_nav.js.coffee
app/assets/javascripts/layout_nav.js.coffee
+30
-14
app/assets/stylesheets/framework/nav.scss
app/assets/stylesheets/framework/nav.scss
+1
-0
No files found.
app/assets/javascripts/layout_nav.js.coffee
View file @
29130f37
class
@
LayoutNav
hideEndFade
=
(
$scrollingTabs
)
->
$
->
$scrollingTabs
.
each
->
$
(
'.fade-left'
).
addClass
(
'end-scroll'
)
$this
=
$
(
@
)
$
(
'.scrolling-tabs'
).
on
'scroll'
,
(
event
)
->
$this
=
$
(
this
)
$this
$el
=
$
(
event
.
target
)
.
find
(
'.fade-right'
)
currentPosition
=
$this
.
scrollLeft
()
.
toggleClass
(
'end-scroll'
,
$this
.
width
()
is
$this
.
prop
(
'scrollWidth'
))
size
=
bp
.
getBreakpointSize
()
controlBtnWidth
=
$
(
'.controls'
).
width
()
$
->
maxPosition
=
$this
.
get
(
0
).
scrollWidth
-
$this
.
parent
().
width
()
$
(
'.fade-left'
).
addClass
(
'end-scroll'
)
maxPosition
+=
controlBtnWidth
if
size
isnt
'xs'
and
$
(
'.nav-control'
).
length
hideEndFade
(
$
(
'.scrolling-tabs'
))
$el
.
find
(
'.fade-left'
).
toggleClass
(
'end-scroll'
,
currentPosition
is
0
)
$el
.
find
(
'.fade-right'
).
toggleClass
(
'end-scroll'
,
currentPosition
is
maxPosition
)
$
(
window
)
.
off
'resize.nav'
.
on
'resize.nav'
,
->
hideEndFade
(
$
(
'.scrolling-tabs'
))
$
(
'.scrolling-tabs'
).
on
'scroll'
,
(
event
)
->
$this
=
$
(
this
)
$el
=
$
(
event
.
target
)
currentPosition
=
$this
.
scrollLeft
()
size
=
bp
.
getBreakpointSize
()
controlBtnWidth
=
$
(
'.controls'
).
width
()
maxPosition
=
(
$this
.
get
(
0
).
scrollWidth
-
$this
.
parent
().
width
())
-
1
# maxPosition += controlBtnWidth if size isnt 'xs' and $('.nav-control').length
console
.
log
maxPosition
,
currentPosition
$el
.
find
(
'.fade-left'
).
toggleClass
(
'end-scroll'
,
currentPosition
is
0
)
$el
.
find
(
'.fade-right'
).
toggleClass
(
'end-scroll'
,
currentPosition
is
maxPosition
)
app/assets/stylesheets/framework/nav.scss
View file @
29130f37
...
@@ -283,6 +283,7 @@
...
@@ -283,6 +283,7 @@
position
:
absolute
;
position
:
absolute
;
top
:
7px
;
top
:
7px
;
right
:
15px
;
right
:
15px
;
z-index
:
2
;
li
.active
{
li
.active
{
font-weight
:
bold
;
font-weight
:
bold
;
...
...
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