Move Special:Watchlist auto-reload check from PHP to JS
[lhc/web/wiklou.git] / resources / src / mediawiki.special / mediawiki.special.watchlist.js
1 /*!
2 * JavaScript for Special:Watchlist
3 */
4 ( function ( mw, $ ) {
5 $( function () {
6 // if the user wishes to reload the watchlist whenever a filter changes
7 if ( mw.user.options.get( 'watchlistreloadautomatically' ) ) {
8 // add a listener on all form elements in the header form
9 $( '#mw-watchlist-form input, #mw-watchlist-form select' ).on( 'change', function () {
10 // submit the form when one of the input fields is modified
11 $( '#mw-watchlist-form' ).submit();
12 } );
13 }
14 } );
15
16 }( mediaWiki, jQuery ) );