From cd2f389d99428a601fcc1442a0190830ed20169c Mon Sep 17 00:00:00 2001 From: John Olheiser Date: Sat, 25 Mar 2023 14:37:34 -0500 Subject: [PATCH] Remove row clicking from notification table (#22695) Resolves #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 Co-authored-by: wxiaoguang --- .../user/notification/notification_div.tmpl | 6 ++-- web_src/css/user.css | 33 ++++++++----------- web_src/js/features/common-global.js | 15 --------- 3 files changed, 17 insertions(+), 37 deletions(-) diff --git a/templates/user/notification/notification_div.tmpl b/templates/user/notification/notification_div.tmpl index 9a4fbe786eab9..101e4d24e46b8 100644 --- a/templates/user/notification/notification_div.tmpl +++ b/templates/user/notification/notification_div.tmpl @@ -35,7 +35,7 @@ {{$issue := .Issue}} {{$repo := .Repository}} - + {{if eq .Status 3}} {{svg "octicon-pin" 16 "text blue"}} {{else if not $issue}} @@ -58,7 +58,7 @@ {{end}} {{end}} - + {{if $issue}} #{{$issue.Index}} - {{$issue.Title}} @@ -67,7 +67,7 @@ {{end}} - + {{$repo.FullName}} diff --git a/web_src/css/user.css b/web_src/css/user.css index c2e08a26857d2..b6a8aa211ad72 100644 --- a/web_src/css/user.css +++ b/web_src/css/user.css @@ -85,23 +85,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; @@ -147,15 +130,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; +} diff --git a/web_src/js/features/common-global.js b/web_src/js/features/common-global.js index a7118068bb359..508749de0069d 100644 --- a/web_src/js/features/common-global.js +++ b/web_src/js/features/common-global.js @@ -134,21 +134,6 @@ export function initGlobalCommon() { toggleElem($($(this).data('target'))); }); - // make table and 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 , then the or 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');