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
c04ef86c
Commit
c04ef86c
authored
Sep 15, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Scrolls active tab into middle of nav on mobile
parent
7ac47516
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
CHANGELOG
CHANGELOG
+1
-0
app/assets/javascripts/layout_nav.js
app/assets/javascripts/layout_nav.js
+19
-3
No files found.
CHANGELOG
View file @
c04ef86c
...
...
@@ -69,6 +69,7 @@ v 8.12.0 (unreleased)
- Show queued time when showing a pipeline !6084
- Remove unused mixins (ClemMakesApps)
- Add search to all issue board lists
- Scroll active tab into view on mobile
- Fix groups sort dropdown alignment (ClemMakesApps)
- Add horizontal scrolling to all sub-navs on mobile viewports (ClemMakesApps)
- Use JavaScript tooltips for mentions !5301 (winniehell)
...
...
app/assets/javascripts/layout_nav.js
View file @
c04ef86c
...
...
@@ -10,11 +10,13 @@
};
$
(
function
()
{
hideEndFade
(
$
(
'
.scrolling-tabs
'
));
var
$scrollingTabs
=
$
(
'
.scrolling-tabs
'
);
hideEndFade
(
$scrollingTabs
);
$
(
window
).
off
(
'
resize.nav
'
).
on
(
'
resize.nav
'
,
function
()
{
return
hideEndFade
(
$
(
'
.scrolling-tabs
'
)
);
return
hideEndFade
(
$
scrollingTabs
);
});
return
$
(
'
.scrolling-tabs
'
).
on
(
'
scroll
'
,
function
(
event
)
{
$scrollingTabs
.
off
(
'
scroll
'
).
on
(
'
scroll
'
,
function
(
event
)
{
var
$this
,
currentPosition
,
maxPosition
;
$this
=
$
(
this
);
currentPosition
=
$this
.
scrollLeft
();
...
...
@@ -22,6 +24,20 @@
$this
.
siblings
(
'
.fade-left
'
).
toggleClass
(
'
scrolling
'
,
currentPosition
>
0
);
return
$this
.
siblings
(
'
.fade-right
'
).
toggleClass
(
'
scrolling
'
,
currentPosition
<
maxPosition
-
1
);
});
$scrollingTabs
.
each
(
function
()
{
var
$this
=
$
(
this
),
scrollingTabWidth
=
$this
.
width
(),
$active
=
$this
.
find
(
'
.active
'
),
activeWidth
=
$active
.
width
(),
offset
=
$active
.
offset
().
left
+
activeWidth
;
if
(
offset
>
scrollingTabWidth
-
30
)
{
var
scrollLeft
=
scrollingTabWidth
/
2
;
scrollLeft
=
(
offset
-
scrollLeft
)
-
(
activeWidth
/
2
);
$this
.
scrollLeft
(
scrollLeft
);
}
});
});
}).
call
(
this
);
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