Merge "Selenium: replace UserLoginPage with BlankPage where possible"
[lhc/web/wiklou.git] / resources / src / mediawiki.special.watchlist / watchlist.js
index b9be51f..e8373c3 100644 (file)
@@ -8,7 +8,7 @@
                // If the user wants to reset their watchlist, use an API call to do so (no reload required)
                // Adapted from a user script by User:NQ of English Wikipedia
                // (User:NQ/WatchlistResetConfirm.js)
-               $resetForm.submit( function ( event ) {
+               $resetForm.on( 'submit', function ( event ) {
                        var $button = $resetForm.find( 'input[name=mw-watchlist-reset-submit]' );
 
                        event.preventDefault();
@@ -41,7 +41,7 @@
                        } ).fail( function () {
                                // On error, fall back to server-side reset
                                // First remove this submit listener and then re-submit the form
-                               $resetForm.off( 'submit' ).submit();
+                               $resetForm.off( 'submit' ).trigger( 'submit' );
                        } );
                } );
 
@@ -50,7 +50,7 @@
                        // add a listener on all form elements in the header form
                        $( '#mw-watchlist-form input, #mw-watchlist-form select' ).on( 'change', function () {
                                // submit the form when one of the input fields is modified
-                               $( '#mw-watchlist-form' ).submit();
+                               $( '#mw-watchlist-form' ).trigger( 'submit' );
                        } );
                }
 
 
                                // 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.
+                               // eslint-disable-next-line no-jquery/no-class-state
                                if ( $unwatchLink.hasClass( 'mw-unwatch-link' ) ) {
                                        api.unwatch( pageTitle )
                                                .done( function () {
 
                                event.preventDefault();
                                event.stopPropagation();
-                               $unwatchLink.blur();
+                               $unwatchLink.trigger( 'blur' );
                        } );
                }
        } );