BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
bc13687c
Commit
bc13687c
authored
Feb 07, 2017
by
Clement Ho
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix-anchor-scrolling' into 'master'
Fix broken anchor links when special characters are used Closes #26778 See merge request !8961
parents
840072ec
bcf81d82
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
0 deletions
+20
-0
common_utils.js.es6
app/assets/javascripts/lib/utils/common_utils.js.es6
+3
-0
fix-anchor-scrolling.yml
changelogs/unreleased/fix-anchor-scrolling.yml
+4
-0
common_utils_spec.js.es6
spec/javascripts/lib/utils/common_utils_spec.js.es6
+13
-0
No files found.
app/assets/javascripts/lib/utils/common_utils.js.es6
View file @
bc13687c
...
...
@@ -69,6 +69,9 @@
var hash = w.gl.utils.getLocationHash();
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');
...
...
changelogs/unreleased/fix-anchor-scrolling.yml
0 → 100644
View file @
bc13687c
---
title
:
Fix broken anchor links when special characters are used
merge_request
:
8961
author
:
Andrey Krivko
spec/javascripts/lib/utils/common_utils_spec.js.es6
View file @
bc13687c
...
...
@@ -41,6 +41,19 @@ require('~/lib/utils/common_utils');
});
});
describe('gl.utils.handleLocationHash', () => {
beforeEach(() => {
window.history.pushState({}, null, '#definição');
});
it('decodes hash parameter', () => {
spyOn(window.document, 'getElementById').and.callThrough();
gl.utils.handleLocationHash();
expect(window.document.getElementById).toHaveBeenCalledWith('definição');
expect(window.document.getElementById).toHaveBeenCalledWith('user-content-definição');
});
});
describe('gl.utils.getParameterByName', () => {
beforeEach(() => {
window.history.pushState({}, null, '?scope=all&p=2');
...
...
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