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
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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
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,14 +11,22 @@
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