Skip to content

Commit cae8c63

Browse files
zeripathsaitho
andauthored
Fix SVG side by side comparison link (#17375) (#17391)
Backport #17375 Define unique names for image tabs in pull requests, in order to toggle tabs correctly when multiple are displayed on one page. Fixes position of swipe-bar so it does not overlay other UI components when scrolling. Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> Co-authored-by: Mario Lubenka <mario.lubenka@googlemail.com>
1 parent 8ace5c1 commit cae8c63

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

templates/repo/diff/image_diff.tmpl

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
<div class="image-diff" data-path-before="{{$imagePathOld}}" data-path-after="{{$imagePathNew}}">
77
<div class="ui secondary pointing tabular top attached borderless menu stackable new-menu">
88
<div class="new-menu-inner">
9-
<a class="item active" data-tab="diff-side-by-side">{{.root.i18n.Tr "repo.diff.image.side_by_side"}}</a>
9+
<a class="item active" data-tab="diff-side-by-side-{{ .file.Index }}">{{.root.i18n.Tr "repo.diff.image.side_by_side"}}</a>
1010
{{if and .blobBase .blobHead}}
11-
<a class="item" data-tab="diff-swipe">{{.root.i18n.Tr "repo.diff.image.swipe"}}</a>
12-
<a class="item" data-tab="diff-overlay">{{.root.i18n.Tr "repo.diff.image.overlay"}}</a>
11+
<a class="item" data-tab="diff-swipe-{{ .file.Index }}">{{.root.i18n.Tr "repo.diff.image.swipe"}}</a>
12+
<a class="item" data-tab="diff-overlay-{{ .file.Index }}">{{.root.i18n.Tr "repo.diff.image.overlay"}}</a>
1313
{{end}}
1414
</div>
1515
</div>
1616
<div class="hide">
17-
<div class="ui bottom attached tab image-diff-container active" data-tab="diff-side-by-side">
17+
<div class="ui bottom attached tab image-diff-container active" data-tab="diff-side-by-side-{{ .file.Index }}">
1818
<div class="diff-side-by-side">
1919
{{if .blobBase }}
2020
<span class="side">
@@ -49,7 +49,7 @@
4949
</div>
5050
</div>
5151
{{if and .blobBase .blobHead}}
52-
<div class="ui bottom attached tab image-diff-container" data-tab="diff-swipe">
52+
<div class="ui bottom attached tab image-diff-container" data-tab="diff-swipe-{{ .file.Index }}">
5353
<div class="diff-swipe">
5454
<div class="swipe-frame">
5555
<span class="before-container"><img class="image-before" /></span>
@@ -63,7 +63,7 @@
6363
</div>
6464
</div>
6565
</div>
66-
<div class="ui bottom attached tab image-diff-container" data-tab="diff-overlay">
66+
<div class="ui bottom attached tab image-diff-container" data-tab="diff-overlay-{{ .file.Index }}">
6767
<div class="diff-overlay">
6868
<div class="overlay-frame">
6969
<div class="ui centered">

web_src/less/features/imagediff.less

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
}
5555

5656
.swipe-bar {
57-
z-index: 100;
5857
position: absolute;
5958
height: 100%;
6059
top: 0;

0 commit comments

Comments
 (0)