Skip to content

Commit cd2f389

Browse files
jolheiserwxiaoguang
authored andcommitted
Remove row clicking from notification table (go-gitea#22695)
Resolves go-gitea#22692 I don't think there's a need for this entire row to be clickable (and even different links depending on which segment you click) The links still point to the same spot, so no information is lost here. --------- Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
1 parent 6705b21 commit cd2f389

File tree

3 files changed

+17
-37
lines changed

3 files changed

+17
-37
lines changed

templates/user/notification/notification_div.tmpl

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
{{$issue := .Issue}}
3636
{{$repo := .Repository}}
3737
<tr id="notification_{{.ID}}">
38-
<td class="collapsing gt-pl-4" data-href="{{.Link}}">
38+
<td class="collapsing gt-pl-4">
3939
{{if eq .Status 3}}
4040
{{svg "octicon-pin" 16 "text blue"}}
4141
{{else if not $issue}}
@@ -58,7 +58,7 @@
5858
{{end}}
5959
{{end}}
6060
</td>
61-
<td class="eleven wide" data-href="{{.Link}}">
61+
<td class="eleven wide">
6262
<a class="item" href="{{.Link}}">
6363
{{if $issue}}
6464
#{{$issue.Index}} - {{$issue.Title}}
@@ -67,7 +67,7 @@
6767
{{end}}
6868
</a>
6969
</td>
70-
<td data-href="{{$repo.Link}}">
70+
<td>
7171
<a class="item" href="{{$repo.Link}}">{{$repo.FullName}}</a>
7272
</td>
7373
<td class="collapsing">

web_src/css/user.css

+14-19
Original file line numberDiff line numberDiff line change
@@ -85,23 +85,6 @@
8585
padding: 8px 15px;
8686
}
8787

88-
.user.notification .content {
89-
float: left;
90-
margin-left: 7px;
91-
}
92-
93-
.user.notification table form {
94-
display: inline-block;
95-
}
96-
97-
.user.notification table button {
98-
padding: 3px 3px 3px 5px;
99-
}
100-
101-
.user.notification table tr {
102-
cursor: pointer;
103-
}
104-
10588
.user .button.adopt,
10689
.user .button.delete {
10790
margin-top: -15px;
@@ -147,15 +130,27 @@
147130
object-fit: contain;
148131
}
149132

133+
.user.notification table button {
134+
padding: 3px 3px 3px 5px;
135+
}
136+
150137
#notification_div .tab.segment {
151138
overflow-x: auto;
152-
padding: 0;
153139
}
154140

155-
#notification_div .menu .active.item {
141+
#notification_div .tabular.menu .active.item {
156142
background: var(--color-box-body);
157143
}
158144

159145
#notification_table {
160146
border: none;
161147
}
148+
149+
#notification_table tr {
150+
cursor: default;
151+
}
152+
153+
#notification_table td a {
154+
width: 100%;
155+
display: inline-block;
156+
}

web_src/js/features/common-global.js

-15
Original file line numberDiff line numberDiff line change
@@ -134,21 +134,6 @@ export function initGlobalCommon() {
134134
toggleElem($($(this).data('target')));
135135
});
136136

137-
// make table <tr> and <td> elements clickable like a link
138-
$('tr[data-href], td[data-href]').on('click', function (e) {
139-
const href = $(this).data('href');
140-
if (e.target.nodeName === 'A') {
141-
// if a user clicks on <a>, then the <tr> or <td> should not act as a link.
142-
return;
143-
}
144-
if (e.ctrlKey || e.metaKey) {
145-
// ctrl+click or meta+click opens a new window in modern browsers
146-
window.open(href);
147-
} else {
148-
window.location = href;
149-
}
150-
});
151-
152137
// prevent multiple form submissions on forms containing .loading-button
153138
document.addEventListener('submit', (e) => {
154139
const btn = e.target.querySelector('.loading-button');

0 commit comments

Comments
 (0)