https://www.mediawiki.org/wiki/Special:Code/MediaWiki/103455
Revision: 103455
Author: nikerabbit
Date: 2011-11-17 11:01:53 +0000 (Thu, 17 Nov 2011)
Log Message:
-----------
Use chaining and prop instead of attr where I think it is correct
Modified Paths:
--------------
trunk/extensions/Narayam/js/ext.narayam.core.js
Modified: trunk/extensions/Narayam/js/ext.narayam.core.js
===================================================================
--- trunk/extensions/Narayam/js/ext.narayam.core.js 2011-11-17 10:50:29 UTC
(rev 103454)
+++ trunk/extensions/Narayam/js/ext.narayam.core.js 2011-11-17 11:01:53 UTC
(rev 103455)
@@ -348,9 +348,10 @@
this.enable = function() {
if ( !enabled ) {
$.cookie( 'narayam-enabled', '1', { 'path': '/',
'expires': 30 } );
- $( '#narayam-toggle' ).attr( 'checked', true );
- $( 'li#pt-narayam').removeClass( 'narayam-inactive' );
- $( 'li#pt-narayam').addClass( 'narayam-active' );
+ $( '#narayam-toggle' ).prop( 'checked', true );
+ $( 'li#pt-narayam')
+ .removeClass( 'narayam-inactive' )
+ .addClass( 'narayam-active' );
enabled = true;
}
};
@@ -361,9 +362,10 @@
this.disable = function() {
if ( enabled ) {
$.cookie( 'narayam-enabled', '0', { 'path': '/',
'expires': 30 } );
- $( '#narayam-toggle' ).attr( 'checked', false );
- $( 'li#pt-narayam').removeClass( 'narayam-active' );
- $( 'li#pt-narayam').addClass( 'narayam-inactive' );
+ $( '#narayam-toggle' ).prop( 'checked', false );
+ $( 'li#pt-narayam')
+ .removeClass( 'narayam-active' )
+ .addClass( 'narayam-inactive' );
enabled = false;
}
};
@@ -474,12 +476,12 @@
}
if ( lastScheme) {
that.setScheme( lastScheme );
- $( '#narayam-' + lastScheme ).attr( 'checked',
'checked' );
+ $( '#narayam-' + lastScheme ).prop( 'checked', true );
} else {
//if no saved input scheme, select the first.
var $firstScheme = $( 'input.narayam-scheme:first' );
that.setScheme( $firstScheme.val() );
- $firstScheme.attr( 'checked', 'checked' );
+ $firstScheme.prop( 'checked', true );
}
var enabledCookie = $.cookie( 'narayam-enabled' );
@@ -611,9 +613,9 @@
that.setScheme( $(this).val() );
// rebuild the menu items with recent items.
$( '#narayam-menu-items' ).html(
$.narayam.buildMenuItems() );
- $( '#narayam-' + $(this).val() ).attr( 'checked',
'checked' );
+ $( '#narayam-' + $(this).val() ).prop( 'checked', true
);
if ( enabled ) {
- $( '#narayam-toggle' ).attr( 'checked', true );
+ $( '#narayam-toggle' ).prop( 'checked', true );
}
} );
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs