Enable sticky header on article and user talk pages

Don't show the talk page link on talk pages themselves.

Bug: T304188
Bug: T309424
Change-Id: I5f4c9373c18d65245416cc3f5b603381abc3de1c
This commit is contained in:
Ed Sanders 2022-04-19 18:42:13 +01:00
parent 2d9585c8e3
commit acc4b3c413

View file

@ -412,7 +412,7 @@ function makeStickyHeaderFunctional(
prepareIcons( header,
document.querySelector( '#ca-history a' ),
document.querySelector( '#ca-talk a' ),
document.querySelector( '#ca-talk:not( .selected ) a' ),
document.querySelector( '#ca-watch a, #ca-unwatch a' )
);
@ -463,8 +463,9 @@ function setupSearchIfNeeded( header ) {
* @return {boolean}
*/
function isAllowedNamespace( namespaceNumber ) {
// Corresponds to Main, User, Wikipedia, Template, Help, Category, Portal, Module.
const allowedNamespaceNumbers = [ 0, 2, 4, 10, 12, 14, 100, 828 ];
// Corresponds to Main, Main talk, User, User talk, Wikipedia,
// Template, Help, Category, Portal, Module.
const allowedNamespaceNumbers = [ 0, 1, 2, 3, 4, 10, 12, 14, 100, 828 ];
return allowedNamespaceNumbers.indexOf( namespaceNumber ) > -1;
}