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
2cd64406
Commit
2cd64406
authored
Sep 20, 2017
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Force two up view
parent
727f51b8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
app/assets/javascripts/commit/image_file.js
app/assets/javascripts/commit/image_file.js
+14
-6
No files found.
app/assets/javascripts/commit/image_file.js
View file @
2cd64406
...
...
@@ -11,15 +11,23 @@
function
ImageFile
(
file
)
{
this
.
file
=
file
;
this
.
requestImageInfo
(
$
(
'
.two-up.view .frame.deleted img
'
,
this
.
file
),
(
function
(
_this
)
{
// Determine if old and new file has same dimensions, if not show 'two-up' view
return
function
(
deletedWidth
,
deletedHeight
)
{
return
_this
.
requestImageInfo
(
$
(
'
.two-up.view .frame.added img
'
,
_this
.
file
),
function
(
width
,
height
)
{
if
(
width
===
deletedWidth
&&
height
===
deletedHeight
)
{
return
_this
.
initViewModes
();
}
else
{
return
_this
.
initView
(
'
two-up
'
);
_this
.
initViewModes
();
// Load two-up view after images are loaded
// so that we can display the correct width and height information
const
images
=
$
(
'
.two-up.view img
'
,
_this
.
file
);
let
loadedCount
=
0
;
images
.
on
(
'
load
'
,
()
=>
{
loadedCount
+=
1
;
if
(
loadedCount
===
images
.
length
)
{
_this
.
initView
(
'
two-up
'
);
}
});
});
};
})(
this
));
}
...
...
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