Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove row clicking from notification table #22695

Merged
merged 10 commits into from
Mar 25, 2023
6 changes: 3 additions & 3 deletions templates/user/notification/notification_div.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
{{$issue := .Issue}}
{{$repo := .Repository}}
<tr id="notification_{{.ID}}">
<td class="collapsing gt-pl-4" data-href="{{.Link}}">
<td class="collapsing gt-pl-4">
{{if eq .Status 3}}
{{svg "octicon-pin" 16 "text blue"}}
{{else if not $issue}}
Expand All @@ -58,7 +58,7 @@
{{end}}
{{end}}
</td>
<td class="eleven wide" data-href="{{.Link}}">
<td class="eleven wide">
<a class="item" href="{{.Link}}">
{{if $issue}}
#{{$issue.Index}} - {{$issue.Title}}
Expand All @@ -67,7 +67,7 @@
{{end}}
</a>
</td>
<td data-href="{{$repo.Link}}">
<td>
<a class="item" href="{{$repo.Link}}">{{$repo.FullName}}</a>
</td>
<td class="collapsing">
Expand Down
33 changes: 14 additions & 19 deletions web_src/css/user.css
Original file line number Diff line number Diff line change
Expand Up @@ -90,23 +90,6 @@
padding: 8px 15px;
}

.user.notification .content {
float: left;
margin-left: 7px;
}

.user.notification table form {
display: inline-block;
}

.user.notification table button {
padding: 3px 3px 3px 5px;
}

.user.notification table tr {
cursor: pointer;
}

.user .button.adopt,
.user .button.delete {
margin-top: -15px;
Expand Down Expand Up @@ -152,15 +135,27 @@
object-fit: contain;
}

.user.notification table button {
padding: 3px 3px 3px 5px;
}

#notification_div .tab.segment {
overflow-x: auto;
padding: 0;
}

#notification_div .menu .active.item {
#notification_div .tabular.menu .active.item {
background: var(--color-box-body);
}

#notification_table {
border: none;
}

#notification_table tr {
cursor: default;
}

#notification_table td a {
width: 100%;
display: inline-block;
}
15 changes: 0 additions & 15 deletions web_src/js/features/common-global.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,21 +124,6 @@ export function initGlobalCommon() {
toggleElem($($(this).data('target')));
});

// make table <tr> and <td> elements clickable like a link
$('tr[data-href], td[data-href]').on('click', function (e) {
const href = $(this).data('href');
if (e.target.nodeName === 'A') {
// if a user clicks on <a>, then the <tr> or <td> should not act as a link.
return;
}
if (e.ctrlKey || e.metaKey) {
// ctrl+click or meta+click opens a new window in modern browsers
window.open(href);
} else {
window.location = href;
}
});

// prevent multiple form submissions on forms containing .loading-button
document.addEventListener('submit', (e) => {
const btn = e.target.querySelector('.loading-button');
Expand Down