]> source.dussan.org Git - gitea.git/commitdiff
Remove row clicking from notification table (#22695)
authorJohn Olheiser <john.olheiser@gmail.com>
Sat, 25 Mar 2023 19:37:34 +0000 (14:37 -0500)
committerGitHub <noreply@github.com>
Sat, 25 Mar 2023 19:37:34 +0000 (14:37 -0500)
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 <john.olheiser@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
templates/user/notification/notification_div.tmpl
web_src/css/user.css
web_src/js/features/common-global.js

index 9a4fbe786eab9d91d1a8304faa06e70cf77e0c4c..101e4d24e46b8a7481f38e6da1ebe26a274c48d1 100644 (file)
@@ -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}}
@@ -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}}
@@ -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">
index 8722181c290718acf24346ad4eaf43f34778f448..620f1da0e2faa44fa1f75ef4a609d6f87015d616 100644 (file)
   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;
   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;
+}
index 3546a052b32dd833c0a3966a5d4701e23c6a7e00..a10ca74ab535ddad3eeb57fdf735d91e592a6466 100644 (file)
@@ -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');