Merge "Selenium: replace UserLoginPage with BlankPage where possible"
[lhc/web/wiklou.git] / resources / src / mediawiki.misc-authed-ooui / special.mute.js
1 ( function () {
2 'use strict';
3
4 $( function () {
5 var $inputs = $( '#mw-specialmute-form input[type="checkbox"]' ),
6 saveButton, $saveButton = $( '#save' );
7
8 function isFormChanged() {
9 return $inputs.is( function () {
10 return this.checked !== this.defaultChecked;
11 } );
12 }
13
14 if ( $saveButton.length ) {
15 saveButton = OO.ui.infuse( $saveButton );
16 saveButton.setDisabled( !isFormChanged() );
17
18 $inputs.on( 'change', function () {
19 saveButton.setDisabled( !isFormChanged() );
20 } );
21 }
22 } );
23 }() );