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
3380ee71
Commit
3380ee71
authored
Mar 23, 2017
by
Eric Eastwood
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix container issue when switching parallel "Changes" MR tab before done loading
Fix
https://gitlab.com/gitlab-org/gitlab-ce/issues/29193
parent
ca6a7f1e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
5 deletions
+29
-5
diff.js
app/assets/javascripts/diff.js
+0
-4
merge_request_tabs_spec.js
spec/javascripts/merge_request_tabs_spec.js
+29
-1
No files found.
app/assets/javascripts/diff.js
View file @
3380ee71
...
...
@@ -13,10 +13,6 @@ class Diff {
$diffFile
.
each
((
index
,
file
)
=>
new
gl
.
ImageFile
(
file
));
if
(
this
.
diffViewType
()
===
'parallel'
)
{
$
(
'.content-wrapper .container-fluid'
).
removeClass
(
'container-limited'
);
}
if
(
!
isBound
)
{
$
(
document
)
.
on
(
'click'
,
'.js-unfold'
,
this
.
handleClickUnfold
.
bind
(
this
))
...
...
spec/javascripts/merge_request_tabs_spec.js
View file @
3380ee71
...
...
@@ -3,6 +3,9 @@
require
(
'~/merge_request_tabs'
);
require
(
'~/breakpoints'
);
require
(
'~/lib/utils/common_utils'
);
require
(
'~/diff'
);
require
(
'~/single_file_diff'
);
require
(
'~/files_comment_button'
);
require
(
'vendor/jquery.scrollTo'
);
(
function
()
{
...
...
@@ -213,6 +216,10 @@ require('vendor/jquery.scrollTo');
describe
(
'with "Side-by-side"/parallel diff view'
,
()
=>
{
beforeEach
(
function
()
{
this
.
class
.
diffViewType
=
()
=>
'parallel'
;
gl
.
Diff
.
prototype
.
diffViewType
=
()
=>
'parallel'
;
spyOn
(
$
,
'ajax'
).
and
.
callFake
(
function
(
options
)
{
options
.
success
({
html
:
''
});
});
});
it
(
'maintains `container-limited` for pipelines tab'
,
function
(
done
)
{
...
...
@@ -224,7 +231,6 @@ require('vendor/jquery.scrollTo');
});
});
};
asyncClick
(
'.merge-request-tabs .pipelines-tab a'
)
.
then
(()
=>
asyncClick
(
'.merge-request-tabs .diffs-tab a'
))
.
then
(()
=>
asyncClick
(
'.merge-request-tabs .pipelines-tab a'
))
...
...
@@ -237,6 +243,28 @@ require('vendor/jquery.scrollTo');
done
.
fail
(
`Something went wrong clicking MR tabs:
${
err
.
message
}
\n
${
err
.
stack
}
`
);
});
});
it
(
'maintains `container-limited` when switching from "Changes" tab before it loads'
,
function
(
done
)
{
const
asyncClick
=
function
(
selector
)
{
return
new
Promise
((
resolve
)
=>
{
setTimeout
(()
=>
{
document
.
querySelector
(
selector
).
click
();
resolve
();
});
});
};
asyncClick
(
'.merge-request-tabs .diffs-tab a'
)
.
then
(()
=>
asyncClick
(
'.merge-request-tabs .notes-tab a'
))
.
then
(()
=>
{
const
hasContainerLimitedClass
=
document
.
querySelector
(
'.content-wrapper .container-fluid'
).
classList
.
contains
(
'container-limited'
);
expect
(
hasContainerLimitedClass
).
toBe
(
true
);
})
.
then
(
done
)
.
catch
((
err
)
=>
{
done
.
fail
(
`Something went wrong clicking MR tabs:
${
err
.
message
}
\n
${
err
.
stack
}
`
);
});
});
});
});
...
...
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