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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
19cb7b0a
Commit
19cb7b0a
authored
Jan 04, 2017
by
Annabel Dunstone Gray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove navbar height offsets
parent
a11e798a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
30 deletions
+5
-30
app/assets/javascripts/build.js
app/assets/javascripts/build.js
+1
-1
app/assets/javascripts/diff_notes/components/jump_to_discussion.js.es6
...vascripts/diff_notes/components/jump_to_discussion.js.es6
+1
-1
app/assets/javascripts/lib/utils/common_utils.js.es6
app/assets/javascripts/lib/utils/common_utils.js.es6
+2
-22
app/assets/javascripts/merge_request_tabs.js.es6
app/assets/javascripts/merge_request_tabs.js.es6
+1
-6
No files found.
app/assets/javascripts/build.js
View file @
19cb7b0a
...
@@ -285,7 +285,7 @@
...
@@ -285,7 +285,7 @@
e
.
preventDefault
();
e
.
preventDefault
();
$currentTarget
=
$
(
e
.
currentTarget
);
$currentTarget
=
$
(
e
.
currentTarget
);
$
.
scrollTo
(
$currentTarget
.
attr
(
'
href
'
),
{
$
.
scrollTo
(
$currentTarget
.
attr
(
'
href
'
),
{
offset
:
-
(
$
(
'
.navbar-gitlab
'
).
outerHeight
()
+
$
(
'
.layout-nav
'
).
outerHeight
())
offset
:
0
});
});
};
};
...
...
app/assets/javascripts/diff_notes/components/jump_to_discussion.js.es6
View file @
19cb7b0a
...
@@ -181,7 +181,7 @@ const Vue = require('vue');
...
@@ -181,7 +181,7 @@ const Vue = require('vue');
}
}
$.scrollTo($target, {
$.scrollTo($target, {
offset:
-($('.navbar-gitlab').outerHeight() + $('.layout-nav').outerHeight())
offset:
0
});
});
}
}
},
},
...
...
app/assets/javascripts/lib/utils/common_utils.js.es6
View file @
19cb7b0a
...
@@ -69,30 +69,18 @@
...
@@ -69,30 +69,18 @@
var hash = w.gl.utils.getLocationHash();
var hash = w.gl.utils.getLocationHash();
if (!hash) return;
if (!hash) return;
// This is required to handle non-unicode characters in hash
hash = decodeURIComponent(hash);
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;
// scroll to user-generated markdown anchor if we cannot find a match
// scroll to user-generated markdown anchor if we cannot find a match
if (document.getElementById(hash) === null) {
if (document.getElementById(hash) === null) {
var target = document.getElementById('user-content-' + hash);
var target = document.getElementById('user-content-' + hash);
if (target && target.scrollIntoView) {
if (target && target.scrollIntoView) {
target.scrollIntoView(true);
target.scrollIntoView(true);
window.scrollBy(0, adjustment);
}
}
} else {
} else {
// only adjust for fixedTabs when not targeting user-generated content
// only adjust for fixedTabs when not targeting user-generated content
var fixedTabs = document.querySelector('.js-tabs-affix');
if (fixedTabs) {
if (fixedTabs) {
adjustment -= fixedTabs.offsetHeight
;
window.scrollBy(0, -fixedTabs.offsetHeight)
;
}
}
window.scrollBy(0, adjustment);
}
}
};
};
...
@@ -137,14 +125,6 @@
...
@@ -137,14 +125,6 @@
return e.metaKey || e.ctrlKey || e.altKey || e.shiftKey;
return e.metaKey || e.ctrlKey || e.altKey || e.shiftKey;
};
};
gl.utils.isMetaClick = function(e) {
// Identify following special clicks
// 1) Cmd + Click on Mac (e.metaKey)
// 2) Ctrl + Click on PC (e.ctrlKey)
// 3) Middle-click or Mouse Wheel Click (e.which is 2)
return e.metaKey || e.ctrlKey || e.which === 2;
};
gl.utils.scrollToElement = function($el) {
gl.utils.scrollToElement = function($el) {
var top = $el.offset().top;
var top = $el.offset().top;
gl.navBarHeight = gl.navBarHeight || $('.navbar-gitlab').height();
gl.navBarHeight = gl.navBarHeight || $('.navbar-gitlab').height();
...
...
app/assets/javascripts/merge_request_tabs.js.es6
View file @
19cb7b0a
...
@@ -125,9 +125,8 @@ require('./flash');
...
@@ -125,9 +125,8 @@ require('./flash');
if (this.diffViewType() === 'parallel') {
if (this.diffViewType() === 'parallel') {
this.expandViewContainer();
this.expandViewContainer();
}
}
const navBarHeight = $('.navbar-gitlab').outerHeight();
$.scrollTo('.merge-request-details .merge-request-tabs', {
$.scrollTo('.merge-request-details .merge-request-tabs', {
offset:
-navBarHeight
,
offset:
0
,
});
});
} else {
} else {
this.expandView();
this.expandView();
...
@@ -141,8 +140,6 @@ require('./flash');
...
@@ -141,8 +140,6 @@ require('./flash');
scrollToElement(container) {
scrollToElement(container) {
if (location.hash) {
if (location.hash) {
const offset = 0 - (
const offset = 0 - (
$('.navbar-gitlab').outerHeight() +
$('.layout-nav').outerHeight() +
$('.js-tabs-affix').outerHeight()
$('.js-tabs-affix').outerHeight()
);
);
const $el = $(`${container} ${location.hash}:not(.match)`);
const $el = $(`${container} ${location.hash}:not(.match)`);
...
@@ -330,8 +327,6 @@ require('./flash');
...
@@ -330,8 +327,6 @@ require('./flash');
if (Breakpoints.get().getBreakpointSize() === 'xs' || !$tabs.length) return;
if (Breakpoints.get().getBreakpointSize() === 'xs' || !$tabs.length) return;
const $diffTabs = $('#diff-notes-app');
const $diffTabs = $('#diff-notes-app');
const $fixedNav = $('.navbar-fixed-top');
const $layoutNav = $('.layout-nav');
$tabs.off('affix.bs.affix affix-top.bs.affix')
$tabs.off('affix.bs.affix affix-top.bs.affix')
.affix({
.affix({
...
...
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