Merge "'lang' attrib in #mw-content-text should be set to variant code."
[lhc/web/wiklou.git] / resources / mediawiki.special / mediawiki.special.recentchanges.js
index 7e284fb..7996d93 100644 (file)
@@ -1,5 +1,5 @@
 /* JavaScript for Special:RecentChanges */
-( function( $ ) {
+( function ( mw, $ ) {
 
        var checkboxes = [ 'nsassociated', 'nsinvert' ];
 
@@ -9,24 +9,24 @@
        var $select = null;
 
        var rc = mw.special.recentchanges = {
-       
+
                /**
                 * Handler to disable/enable the namespace selector checkboxes when the
                 * special 'all' namespace is selected/unselected respectively.
                 */
-               updateCheckboxes: function() {
+               updateCheckboxes: function () {
                        // The option element for the 'all' namespace has an empty value
-                       var isAllNS = ('' === $select.find('option:selected').val() );
+                       var isAllNS = $select.find('option:selected').val() === '';
 
                        // Iterates over checkboxes and propagate the selected option
-                       $.each( checkboxes, function( i, id ) {
-                               $( '#' + id ).attr( 'disabled', isAllNS );
+                       $.each( checkboxes, function ( i, id ) {
+                               $( '#' + id ).prop( 'disabled', isAllNS );
                        });
                },
 
-               init: function() {
+               init: function () {
                        // Populate
-                       $select = $( '#namespace' );
+                       $select = $( '#namespace' );
 
                        // Bind to change event, and trigger once to set the initial state of the checkboxes.
                        $select.change( rc.updateCheckboxes ).change();
@@ -36,4 +36,4 @@
        // Run when document is ready
        $( rc.init );
 
-})( jQuery );
+}( mediaWiki, jQuery ) );