Commit 5402c918 authored by Phil Hughes's avatar Phil Hughes

Merge branch '56762-fix-commit-view' into 'master'

Fix old image diff swipe view

Closes #56762

See merge request gitlab-org/gitlab-ce!26968
parents 9ee30346 fa71715e
...@@ -167,6 +167,23 @@ ...@@ -167,6 +167,23 @@
} }
} }
.frame {
top: 0;
right: 0;
&.old-diff {
/* only for commit / compare view */
position: absolute;
}
&.deleted {
margin: 0;
display: block;
top: 13px;
right: 7px;
}
}
.swipe-bar { .swipe-bar {
display: block; display: block;
height: 100%; height: 100%;
......
...@@ -35,10 +35,10 @@ ...@@ -35,10 +35,10 @@
.swipe.view.hide .swipe.view.hide
.swipe-frame .swipe-frame
.frame.deleted .frame.deleted.old-diff
= image_tag(old_blob_raw_url, alt: diff_file.old_path, lazy: false) = image_tag(old_blob_raw_url, alt: diff_file.old_path, lazy: false)
.swipe-wrap.left-oriented .swipe-wrap.left-oriented
= render partial: "projects/diffs/image_diff_frame", locals: { class_name: "added js-image-frame #{class_name}", position: position, note_type: DiffNote.name, image_path: blob_raw_url, alt: diff_file.new_path } = render partial: "projects/diffs/image_diff_frame", locals: { class_name: "added old-diff js-image-frame #{class_name}", position: position, note_type: DiffNote.name, image_path: blob_raw_url, alt: diff_file.new_path }
%span.swipe-bar %span.swipe-bar
%span.top-handle %span.top-handle
%span.bottom-handle %span.bottom-handle
......
...@@ -10,5 +10,5 @@ ...@@ -10,5 +10,5 @@
.image.js-single-image{ data: diff_view_data } .image.js-single-image{ data: diff_view_data }
.wrap .wrap
- single_class_name = diff_file.deleted_file? ? 'deleted' : 'added' - single_class_name = diff_file.deleted_file? ? 'deleted' : 'added'
= render partial: "projects/diffs/image_diff_frame", locals: { class_name: "#{single_class_name} #{class_name} js-image-frame", position: position, note_type: DiffNote.name, image_path: blob_raw_url, alt: diff_file.file_path } = render partial: "projects/diffs/image_diff_frame", locals: { class_name: "#{single_class_name} #{class_name} old-diff js-image-frame", position: position, note_type: DiffNote.name, image_path: blob_raw_url, alt: diff_file.file_path }
%p.image-info= number_to_human_size(blob.size) %p.image-info= number_to_human_size(blob.size)
---
title: "Fix image diff swipe view on commit and compare pages"
merge_request: 26968
author: ftab
type: fixed
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment