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
db56c32c
Commit
db56c32c
authored
Nov 20, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed the dimensions of image diffs
Closes
https://gitlab.com/gitlab-org/gitlab-ce/issues/54236
parent
4916de75
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
35 deletions
+12
-35
app/assets/javascripts/vue_shared/components/content_viewer/viewers/image_viewer.vue
...shared/components/content_viewer/viewers/image_viewer.vue
+0
-8
app/assets/javascripts/vue_shared/components/diff_viewer/viewers/image_diff/swipe_viewer.vue
...omponents/diff_viewer/viewers/image_diff/swipe_viewer.vue
+8
-10
app/assets/javascripts/vue_shared/components/diff_viewer/viewers/image_diff/two_up_viewer.vue
...mponents/diff_viewer/viewers/image_diff/two_up_viewer.vue
+3
-3
app/assets/stylesheets/pages/diff.scss
app/assets/stylesheets/pages/diff.scss
+1
-14
No files found.
app/assets/javascripts/vue_shared/components/content_viewer/viewers/image_viewer.vue
View file @
db56c32c
...
@@ -34,14 +34,7 @@ export default {
...
@@ -34,14 +34,7 @@ export default {
fileSizeReadable
()
{
fileSizeReadable
()
{
return
numberToHumanSize
(
this
.
fileSize
);
return
numberToHumanSize
(
this
.
fileSize
);
},
},
dimensionStyles
()
{
if
(
!
this
.
isLoaded
)
return
{};
return
{
width
:
`
${
this
.
width
}
px`
,
height
:
`
${
this
.
height
}
px`
,
};
},
hasFileSize
()
{
hasFileSize
()
{
return
this
.
fileSize
>
0
;
return
this
.
fileSize
>
0
;
},
},
...
@@ -89,7 +82,6 @@ export default {
...
@@ -89,7 +82,6 @@ export default {
<div>
<div>
<div
<div
:class=
"innerCssClasses"
:class=
"innerCssClasses"
:style=
"dimensionStyles"
class=
"position-relative"
class=
"position-relative"
>
>
<img
<img
...
...
app/assets/javascripts/vue_shared/components/diff_viewer/viewers/image_diff/swipe_viewer.vue
View file @
db56c32c
...
@@ -25,7 +25,7 @@ export default {
...
@@ -25,7 +25,7 @@ export default {
swipeMaxWidth
:
undefined
,
swipeMaxWidth
:
undefined
,
swipeMaxHeight
:
undefined
,
swipeMaxHeight
:
undefined
,
swipeBarPos
:
1
,
swipeBarPos
:
1
,
swipeWrapWidth
:
undefined
,
swipeWrapWidth
:
0
,
};
};
},
},
computed
:
{
computed
:
{
...
@@ -63,7 +63,7 @@ export default {
...
@@ -63,7 +63,7 @@ export default {
leftValue
=
clientWidth
-
spaceLeft
;
leftValue
=
clientWidth
-
spaceLeft
;
}
}
this
.
swipeWrapWidth
=
this
.
swipeMaxWidth
-
leftValue
;
this
.
swipeWrapWidth
=
(
leftValue
/
clientWidth
)
*
100
;
this
.
swipeBarPos
=
leftValue
;
this
.
swipeBarPos
=
leftValue
;
},
},
startDrag
()
{
startDrag
()
{
...
@@ -81,7 +81,6 @@ export default {
...
@@ -81,7 +81,6 @@ export default {
// Add 2 for border width
// Add 2 for border width
this
.
swipeMaxWidth
=
this
.
swipeMaxWidth
=
Math
.
max
(
this
.
swipeOldImgInfo
.
renderedWidth
,
this
.
swipeNewImgInfo
.
renderedWidth
)
+
2
;
Math
.
max
(
this
.
swipeOldImgInfo
.
renderedWidth
,
this
.
swipeNewImgInfo
.
renderedWidth
)
+
2
;
this
.
swipeWrapWidth
=
this
.
swipeMaxWidth
;
this
.
swipeMaxHeight
=
this
.
swipeMaxHeight
=
Math
.
max
(
this
.
swipeOldImgInfo
.
renderedHeight
,
this
.
swipeNewImgInfo
.
renderedHeight
)
+
2
;
Math
.
max
(
this
.
swipeOldImgInfo
.
renderedHeight
,
this
.
swipeNewImgInfo
.
renderedHeight
)
+
2
;
...
@@ -107,10 +106,6 @@ export default {
...
@@ -107,10 +106,6 @@ export default {
<div
class=
"swipe view"
>
<div
class=
"swipe view"
>
<div
<div
ref=
"swipeFrame"
ref=
"swipeFrame"
:style=
"
{
'width': swipeMaxPixelWidth,
'height': swipeMaxPixelHeight,
}"
class=
"swipe-frame"
>
class=
"swipe-frame"
>
<image-viewer
<image-viewer
key=
"swipeOldImg"
key=
"swipeOldImg"
...
@@ -123,14 +118,17 @@ export default {
...
@@ -123,14 +118,17 @@ export default {
<div
<div
ref=
"swipeWrap"
ref=
"swipeWrap"
:style=
"
{
:style=
"
{
'width': swipeWrapPixelWidth,
width: `${swipeWrapWidth}%`
'height': swipeMaxPixelHeight,
}"
}"
class="swipe-wrap">
class="swipe-wrap"
>
<image-viewer
<image-viewer
key=
"swipeNewImg"
key=
"swipeNewImg"
:render-info=
"false"
:render-info=
"false"
:path=
"newPath"
:path=
"newPath"
:style=
"
{
width: swipeMaxPixelWidth
}"
class="frame added"
class="frame added"
@imgLoaded="swipeNewImgLoaded"
@imgLoaded="swipeNewImgLoaded"
>
>
...
...
app/assets/javascripts/vue_shared/components/diff_viewer/viewers/image_diff/two_up_viewer.vue
View file @
db56c32c
...
@@ -19,18 +19,18 @@ export default {
...
@@ -19,18 +19,18 @@ export default {
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"two-up view"
>
<div
class=
"two-up view
d-flex
"
>
<image-viewer
<image-viewer
:path=
"oldPath"
:path=
"oldPath"
:render-info=
"true"
:render-info=
"true"
inner-css-classes=
"frame deleted"
inner-css-classes=
"frame deleted"
class=
"wrap"
class=
"wrap
w-50
"
/>
/>
<image-viewer
<image-viewer
:path=
"newPath"
:path=
"newPath"
:render-info=
"true"
:render-info=
"true"
:inner-css-classes=
"['frame', 'added']"
:inner-css-classes=
"['frame', 'added']"
class=
"wrap"
class=
"wrap
w-50
"
>
>
<slot
<slot
slot=
"image-overlay"
slot=
"image-overlay"
...
...
app/assets/stylesheets/pages/diff.scss
View file @
db56c32c
...
@@ -253,19 +253,6 @@
...
@@ -253,19 +253,6 @@
right
:
7px
;
right
:
7px
;
}
}
.frame
{
top
:
0
;
right
:
0
;
position
:
absolute
;
&
.deleted
{
margin
:
0
;
display
:
block
;
top
:
13px
;
right
:
7px
;
}
}
.swipe-bar
{
.swipe-bar
{
display
:
block
;
display
:
block
;
height
:
100%
;
height
:
100%
;
...
@@ -435,7 +422,7 @@
...
@@ -435,7 +422,7 @@
.onion-skin.view
{
.onion-skin.view
{
.swipe-wrap
{
.swipe-wrap
{
top
:
0
;
top
:
0
;
righ
t
:
0
;
lef
t
:
0
;
}
}
.frame.deleted
{
.frame.deleted
{
...
...
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