diff options
author | ftab <fury@xibase.com> | 2019-04-05 10:33:51 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-04-05 10:33:51 +0300 |
commit | fa71715e067a0dd2d3982454a4d2618dbeb16ef9 (patch) | |
tree | caea52a389645afce6658cd1e404055bd98353d1 /app | |
parent | 9ee30346f203a47c1928f83c7de21b0e86fe3817 (diff) |
Fix old image diff swipe view
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/stylesheets/pages/diff.scss | 17 | ||||
-rw-r--r-- | app/views/projects/diffs/_replaced_image_diff.html.haml | 4 | ||||
-rw-r--r-- | app/views/projects/diffs/_single_image_diff.html.haml | 2 |
3 files changed, 20 insertions, 3 deletions
diff --git a/app/assets/stylesheets/pages/diff.scss b/app/assets/stylesheets/pages/diff.scss index 54d985df9b5..ebc5226bf87 100644 --- a/app/assets/stylesheets/pages/diff.scss +++ b/app/assets/stylesheets/pages/diff.scss @@ -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 { display: block; height: 100%; diff --git a/app/views/projects/diffs/_replaced_image_diff.html.haml b/app/views/projects/diffs/_replaced_image_diff.html.haml index 70521ed892e..566dfe798c6 100644 --- a/app/views/projects/diffs/_replaced_image_diff.html.haml +++ b/app/views/projects/diffs/_replaced_image_diff.html.haml @@ -35,10 +35,10 @@ .swipe.view.hide .swipe-frame - .frame.deleted + .frame.deleted.old-diff = image_tag(old_blob_raw_url, alt: diff_file.old_path, lazy: false) .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.top-handle %span.bottom-handle diff --git a/app/views/projects/diffs/_single_image_diff.html.haml b/app/views/projects/diffs/_single_image_diff.html.haml index 454f814795a..daac543b939 100644 --- a/app/views/projects/diffs/_single_image_diff.html.haml +++ b/app/views/projects/diffs/_single_image_diff.html.haml @@ -10,5 +10,5 @@ .image.js-single-image{ data: diff_view_data } .wrap - 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) |