MediaWiki:Common.js: Difference between revisions

mNo edit summary
Tag: Reverted
mNo edit summary
Tag: Reverted
Line 66: Line 66:
         // Update the "Page" tab (ca-nstab-main) link to go back to the previous page (or the main page)
         // Update the "Page" tab (ca-nstab-main) link to go back to the previous page (or the main page)
         $('#ca-nstab-main').show().find('a').attr('href', previousPage || '/wiki/Main_Page');  // Default to main page if no previous page
         $('#ca-nstab-main').show().find('a').attr('href', previousPage || '/wiki/Main_Page');  // Default to main page if no previous page
       
        // Disable the click on the Discord tab to avoid repeating the action and breaking the referrer history
        $('#ca-my_namespace a').on('click', function(event) {
            event.preventDefault(); // Prevent the default action (i.e., reloading the current page)
        });
     } else {
     } else {
         // If not on the Discord page, reset the tabs to their normal state
         // If not on the Discord page, reset the tabs to their normal state