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
Boxiang Sun
gitlab-ce
Commits
ffd28232
Commit
ffd28232
authored
Nov 21, 2016
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove duplicate functionality (bad merge conflict resolution?)
parent
24e5a1e8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
28 deletions
+19
-28
app/assets/javascripts/application.js
app/assets/javascripts/application.js
+6
-25
app/assets/javascripts/lib/utils/common_utils.js
app/assets/javascripts/lib/utils/common_utils.js
+13
-3
No files found.
app/assets/javascripts/application.js
View file @
ffd28232
...
...
@@ -57,32 +57,13 @@
(
function
()
{
document
.
addEventListener
(
'
page:fetch
'
,
gl
.
utils
.
cleanupBeforeFetch
);
window
.
addEventListener
(
'
hashchange
'
,
gl
.
utils
.
shiftWindow
);
// automatically adjust scroll position for hash urls taking the height of the navbar into account
// https://github.com/twitter/bootstrap/issues/1768
window
.
adjustScroll
=
function
()
{
var
navbar
=
document
.
querySelector
(
'
.navbar-gitlab
'
);
var
subnav
=
document
.
querySelector
(
'
.layout-nav
'
);
var
fixedTabs
=
document
.
querySelector
(
'
.js-tabs-affix
'
);
adjustment
=
0
;
if
(
navbar
)
adjustment
-=
navbar
.
offsetHeight
;
if
(
subnav
)
adjustment
-=
subnav
.
offsetHeight
;
if
(
fixedTabs
)
adjustment
-=
fixedTabs
.
offsetHeight
;
return
scrollBy
(
0
,
adjustment
);
};
window
.
addEventListener
(
"
hashchange
"
,
adjustScroll
);
window
.
onload
=
function
()
{
// Scroll the window to avoid the topnav bar
// https://github.com/twitter/bootstrap/issues/1768
if
(
location
.
hash
)
{
return
setTimeout
(
adjustScroll
,
100
);
window
.
addEventListener
(
'
hashchange
'
,
gl
.
utils
.
handleLocationHash
);
window
.
addEventListener
(
'
load
'
,
function
onLoad
()
{
window
.
removeEventListener
(
'
load
'
,
onLoad
,
false
);
if
(
window
.
location
.
hash
)
{
setTimeout
(
gl
.
utils
.
handleLocationHash
,
100
);
}
};
}
,
false
)
;
$
(
function
()
{
var
$body
=
$
(
'
body
'
);
...
...
app/assets/javascripts/lib/utils/common_utils.js
View file @
ffd28232
...
...
@@ -94,10 +94,20 @@
return
$
(
document
).
off
(
'
scroll
'
);
};
w
.
gl
.
utils
.
shiftWindow
=
function
()
{
return
w
.
scrollBy
(
0
,
-
100
);
};
// automatically adjust scroll position for hash urls taking the height of the navbar into account
// https://github.com/twitter/bootstrap/issues/1768
w
.
gl
.
utils
.
handleLocationHash
=
function
()
{
var
navbar
=
document
.
querySelector
(
'
.navbar-gitlab
'
);
var
subnav
=
document
.
querySelector
(
'
.layout-nav
'
);
var
fixedTabs
=
document
.
querySelector
(
'
.js-tabs-affix
'
);
var
adjustment
=
0
;
if
(
navbar
)
adjustment
-=
navbar
.
offsetHeight
;
if
(
subnav
)
adjustment
-=
subnav
.
offsetHeight
;
if
(
fixedTabs
)
adjustment
-=
fixedTabs
.
offsetHeight
;
window
.
scrollBy
(
0
,
adjustment
);
};
gl
.
utils
.
updateTooltipTitle
=
function
(
$tooltipEl
,
newTitle
)
{
return
$tooltipEl
.
tooltip
(
'
destroy
'
).
attr
(
'
title
'
,
newTitle
).
tooltip
(
'
fixTitle
'
);
...
...
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