Skip to content

Commit 8a0fef1

Browse files
committed
Unique names for image tabs in pull request
Define unique names for image tabs in pull requests, in order to toggle tabs correctly when multiple are displayed on one page. Signed-off-by: Mario Lubenka <[email protected]>
1 parent 7f81876 commit 8a0fef1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

templates/repo/diff/image_diff.tmpl

Lines changed: 6 additions & 6 deletions
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">

0 commit comments

Comments
 (0)