X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=resources%2Fsrc%2Fmediawiki.special%2Fmediawiki.special.watchlist.js;h=565ed2c974dc12d917cf5e72144d36bc66f8225b;hp=535ca9375322c89d74e85d08c53b01a2d8d7b91c;hb=faf7cc4a09848c538320bd2b9067b1a77c0a0183;hpb=237d3271fd313ebe09858a5c442a91216a7b61cf diff --git a/resources/src/mediawiki.special/mediawiki.special.watchlist.js b/resources/src/mediawiki.special/mediawiki.special.watchlist.js index 535ca93753..565ed2c974 100644 --- a/resources/src/mediawiki.special/mediawiki.special.watchlist.js +++ b/resources/src/mediawiki.special/mediawiki.special.watchlist.js @@ -59,7 +59,7 @@ // If a page is on the watchlist, a '×' is shown which, when clicked, removes the page from the watchlist. // After unwatching a page, the '×' becomes a '+', which if clicked re-watches the page. // Unwatched page entries are struck through and have lowered opacity. - $( '.mw-unwatch-link, .mw-watch-link' ).click( function ( event ) { + $( '.mw-changeslist' ).on( 'click', '.mw-unwatch-link, .mw-watch-link', function ( event ) { var $unwatchLink = $( this ), // EnhancedChangesList uses for each row, while OldChangesList uses
  • for each row $watchlistLine = $unwatchLink.closest( 'li, table' ) .find( '[data-target-page]' ), @@ -97,6 +97,9 @@ } ); } + // Preload the notification module for mw.notify + mw.loader.load( 'mediawiki.notification' ); + // Depending on whether we are watching or unwatching, for each entry of the page (and its associated page i.e. Talk), // change the text, tooltip, and non-JS href of the (un)watch button, and update the styling of the watchlist entry. if ( $unwatchLink.hasClass( 'mw-unwatch-link' ) ) {