From fcc333412534269612fd9089f703ea66aa36ffc5 Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Sat, 5 Oct 2024 00:33:58 +0330 Subject: [PATCH] Make category links arrow link to actual categories I believe having arrows linked to the actual pages can be much more useful than linking to '#' of the same page. Linking to the correct page makes user to notice if the page is already visited also using color of the arrow. If we didn't like link visited logic to be not used we could've used a different link rather than color of links and going makes us able to :visited logic of If8b2b45b24351ee5c8fc9ee1380563f5d5b88678 also. Personally however I'm in believe that having a useful link that can be opened on a different tab using Ctrl (or long click on phones) is always more useful. Change-Id: Ib56fad0b711853d67b2d55617b36deff56141c74 --- includes/CategoryTree.php | 1 + modules/ext.categoryTree/ext.categoryTree.js | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/CategoryTree.php b/includes/CategoryTree.php index d814e4da..14dc8afe 100644 --- a/includes/CategoryTree.php +++ b/includes/CategoryTree.php @@ -372,6 +372,7 @@ class CategoryTree { // href and role will be added client-side 'class' => 'CategoryTreeToggle', 'data-ct-title' => $key, + 'href' => $title->getLocalURL(), ]; if ( $children === 0 ) { diff --git a/modules/ext.categoryTree/ext.categoryTree.js b/modules/ext.categoryTree/ext.categoryTree.js index 2f2c78d6..c02e7eae 100644 --- a/modules/ext.categoryTree/ext.categoryTree.js +++ b/modules/ext.categoryTree/ext.categoryTree.js @@ -90,7 +90,6 @@ $content.find( '.CategoryTreeToggle' ) .on( 'click', handleNode ) .attr( { - href: '#', role: 'button', title: function () { return mw.msg(