Preload the module 'mediawiki.notification' in parallel to the API
request because mw.notify is called on API response.
Change-Id: Ief8de75bc9392315a867fe1c4cf11ce4d0e9bfb8
}
$link.data( 'mwDisabled', true ).addClass( 'mw-watch-link-disabled' );
+ // Preload the notification module for mw.notify
+ mw.loader.load( 'mediawiki.notification' );
+
// Use the class to determine whether to watch or unwatch
if ( !$subjectLink.hasClass( 'mw-watched-item' ) ) {
$link.text( mw.msg( 'watching' ) );
} );
}
+ // 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' ) ) {