Merge "Translate some magic words to Czech"
[lhc/web/wiklou.git] / resources / src / mediawiki.special / mediawiki.special.userrights.js
index 0643988..d3494f7 100644 (file)
@@ -1,8 +1,13 @@
 /*!
  * JavaScript for Special:UserRights
  */
-( function () {
+( function ( $ ) {
        var convertmessagebox = require( 'mediawiki.notification.convertmessagebox' );
        // Replace successbox with notifications
        convertmessagebox();
-}() );
+
+       // Dynamically show/hide the "other time" input under each dropdown
+       $( '.mw-userrights-nested select' ).on( 'change', function ( e ) {
+               $( e.target.parentNode ).find( 'input' ).toggle( $( e.target ).val() === 'other' );
+       } );
+}( jQuery ) );