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
Léo-Paul Géneau
gitlab-ce
Commits
37d3d07b
Commit
37d3d07b
authored
Feb 12, 2018
by
Eric Eastwood
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix settings panel not expanding when fragment hash linked
See
https://gitlab.com/gitlab-org/gitlab-ce/issues/43198
parent
ee8e5a59
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
1 deletion
+35
-1
app/assets/javascripts/settings_panels.js
app/assets/javascripts/settings_panels.js
+1
-1
changelogs/unreleased/43198-fix-settings-panel-expanding-when-fragment-hash-linked.yml
...ix-settings-panel-expanding-when-fragment-hash-linked.yml
+5
-0
spec/javascripts/settings_panels_spec.js
spec/javascripts/settings_panels_spec.js
+29
-0
No files found.
app/assets/javascripts/settings_panels.js
View file @
37d3d07b
...
...
@@ -42,7 +42,7 @@ export default function initSettingsPanels() {
if
(
location
.
hash
)
{
const
$target
=
$
(
location
.
hash
);
if
(
$target
.
length
&&
$target
.
hasClass
(
'
.
settings
'
))
{
if
(
$target
.
length
&&
$target
.
hasClass
(
'
settings
'
))
{
expandSection
(
$target
);
}
}
...
...
changelogs/unreleased/43198-fix-settings-panel-expanding-when-fragment-hash-linked.yml
0 → 100644
View file @
37d3d07b
---
title
:
Fix settings panels not expanding when fragment hash linked
merge_request
:
17074
author
:
type
:
fixed
spec/javascripts/settings_panels_spec.js
0 → 100644
View file @
37d3d07b
import
initSettingsPanels
from
'
~/settings_panels
'
;
describe
(
'
Settings Panels
'
,
()
=>
{
preloadFixtures
(
'
projects/ci_cd_settings.html.raw
'
);
beforeEach
(()
=>
{
loadFixtures
(
'
projects/ci_cd_settings.html.raw
'
);
});
describe
(
'
initSettingsPane
'
,
()
=>
{
afterEach
(()
=>
{
location
.
hash
=
''
;
});
it
(
'
should expand linked hash fragment panel
'
,
()
=>
{
location
.
hash
=
'
#js-general-pipeline-settings
'
;
const
pipelineSettingsPanel
=
document
.
querySelector
(
'
#js-general-pipeline-settings
'
);
// Our test environment automatically expands everything so we need to clear that out first
pipelineSettingsPanel
.
classList
.
remove
(
'
expanded
'
);
expect
(
pipelineSettingsPanel
.
classList
.
contains
(
'
expanded
'
)).
toBe
(
false
);
initSettingsPanels
();
expect
(
pipelineSettingsPanel
.
classList
.
contains
(
'
expanded
'
)).
toBe
(
true
);
});
});
});
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