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
bfd4ef43
Commit
bfd4ef43
authored
Dec 20, 2019
by
Jan Beckmann
Committed by
Kushal Pandya
Dec 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delay window.scrollBy in handleLocationHash to fix FF bug
Closes #19132
parent
23f058eb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
app/assets/javascripts/lib/utils/common_utils.js
app/assets/javascripts/lib/utils/common_utils.js
+3
-1
changelogs/unreleased/19132-comment-anchor-twice-firefox.yml
changelogs/unreleased/19132-comment-anchor-twice-firefox.yml
+5
-0
spec/javascripts/lib/utils/common_utils_spec.js
spec/javascripts/lib/utils/common_utils_spec.js
+3
-0
No files found.
app/assets/javascripts/lib/utils/common_utils.js
View file @
bfd4ef43
...
@@ -135,7 +135,9 @@ export const handleLocationHash = () => {
...
@@ -135,7 +135,9 @@ export const handleLocationHash = () => {
adjustment
-=
topPadding
;
adjustment
-=
topPadding
;
}
}
window
.
scrollBy
(
0
,
adjustment
);
setTimeout
(()
=>
{
window
.
scrollBy
(
0
,
adjustment
);
});
};
};
// Check if element scrolled into viewport from above or below
// Check if element scrolled into viewport from above or below
...
...
changelogs/unreleased/19132-comment-anchor-twice-firefox.yml
0 → 100644
View file @
bfd4ef43
---
title
:
Fix bug when clicking on same note twice in Firefox
merge_request
:
21699
author
:
Jan Beckmann
type
:
fixed
spec/javascripts/lib/utils/common_utils_spec.js
View file @
bfd4ef43
...
@@ -88,10 +88,12 @@ describe('common_utils', () => {
...
@@ -88,10 +88,12 @@ describe('common_utils', () => {
describe
(
'
handleLocationHash
'
,
()
=>
{
describe
(
'
handleLocationHash
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
spyOn
(
window
.
document
,
'
getElementById
'
).
and
.
callThrough
();
spyOn
(
window
.
document
,
'
getElementById
'
).
and
.
callThrough
();
jasmine
.
clock
().
install
();
});
});
afterEach
(()
=>
{
afterEach
(()
=>
{
window
.
history
.
pushState
({},
null
,
''
);
window
.
history
.
pushState
({},
null
,
''
);
jasmine
.
clock
().
uninstall
();
});
});
function
expectGetElementIdToHaveBeenCalledWith
(
elementId
)
{
function
expectGetElementIdToHaveBeenCalledWith
(
elementId
)
{
...
@@ -171,6 +173,7 @@ describe('common_utils', () => {
...
@@ -171,6 +173,7 @@ describe('common_utils', () => {
window
.
history
.
pushState
({},
null
,
'
#test
'
);
window
.
history
.
pushState
({},
null
,
'
#test
'
);
commonUtils
.
handleLocationHash
();
commonUtils
.
handleLocationHash
();
jasmine
.
clock
().
tick
(
1
);
expectGetElementIdToHaveBeenCalledWith
(
'
test
'
);
expectGetElementIdToHaveBeenCalledWith
(
'
test
'
);
expectGetElementIdToHaveBeenCalledWith
(
'
user-content-test
'
);
expectGetElementIdToHaveBeenCalledWith
(
'
user-content-test
'
);
...
...
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