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
74f80465
Commit
74f80465
authored
Aug 17, 2016
by
Annabel Dunstone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove index from pipeline toggles
parent
ab44aa7b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
+12
-10
app/assets/javascripts/pipeline.js.es6
app/assets/javascripts/pipeline.js.es6
+11
-9
app/views/projects/commit/_pipeline.html.haml
app/views/projects/commit/_pipeline.html.haml
+1
-1
No files found.
app/assets/javascripts/pipeline.js.es6
View file @
74f80465
function toggleGraph() {
(function() {
const indexOfBtn = $('.toggle-pipeline-btn').index($(this));
function toggleGraph() {
const $pipelineBtn = $(this).closest('.toggle-pipeline-btn');
const $pipelineGraph = $(this).closest('.row-content-block').next('.pipeline-graph');
const $btnText = $(this).find('.toggle-btn-text');
$($('.pipeline-graph')[indexOfBtn]).toggleClass('graph-collapsed');
$($pipelineBtn).add($pipelineGraph).toggleClass('graph-collapsed');
$($('.toggle-pipeline-btn')[indexOfBtn]).toggleClass('graph-collapsed');
const $btnText = $($('.toggle-pipeline-btn .btn-text')[indexOfBtn]);
const graphCollapsed = $pipelineGraph.hasClass('graph-collapsed');
const graphCollapsed = $($('.pipeline-graph')[indexOfBtn]).hasClass('graph-collapsed');
graphCollapsed ? $btnText.text('Expand') : $btnText.text('Hide')
graphCollapsed ? $btnText.text('Expand') : $btnText.text('Hide')
}
}
$(document).on('click', '.toggle-pipeline-btn', toggleGraph);
$(document).on('click', '.toggle-pipeline-btn', toggleGraph);
})();
app/views/projects/commit/_pipeline.html.haml
View file @
74f80465
.row-content-block.build-content.middle-block.pipeline-actions
.row-content-block.build-content.middle-block.pipeline-actions
.pull-right
.pull-right
.btn.btn-grouped.btn-white.toggle-pipeline-btn
.btn.btn-grouped.btn-white.toggle-pipeline-btn
%span
.btn-text
Hide
%span
.
toggle-
btn-text
Hide
%span
pipeline graph
%span
pipeline graph
%span
.caret
%span
.caret
-
if
can?
(
current_user
,
:update_pipeline
,
pipeline
.
project
)
-
if
can?
(
current_user
,
:update_pipeline
,
pipeline
.
project
)
...
...
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