Fix select all checkboxes JS function, another .attr() vs .prop() case in jQuery 1.6.1, fixes #17527

git-svn-id: https://develop.svn.wordpress.org/trunk@17979 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2011-05-20 22:47:36 +00:00
parent 5fe94e6993
commit 7228202817
3 changed files with 15 additions and 15 deletions

View File

@ -276,30 +276,30 @@ $(document).ready( function() {
}); });
$('thead, tfoot').find('.check-column :checkbox').click( function(e) { $('thead, tfoot').find('.check-column :checkbox').click( function(e) {
var c = $(this).attr('checked'), var c = $(this).prop('checked'),
kbtoggle = 'undefined' == typeof toggleWithKeyboard ? false : toggleWithKeyboard, kbtoggle = 'undefined' == typeof toggleWithKeyboard ? false : toggleWithKeyboard,
toggle = e.shiftKey || kbtoggle; toggle = e.shiftKey || kbtoggle;
$(this).closest( 'table' ).children( 'tbody' ).filter(':visible') $(this).closest( 'table' ).children( 'tbody' ).filter(':visible')
.children().children('.check-column').find(':checkbox') .children().children('.check-column').find(':checkbox')
.attr('checked', function() { .prop('checked', function() {
if ( $(this).closest('tr').is(':hidden') ) if ( $(this).closest('tr').is(':hidden') )
return ''; return false;
if ( toggle ) if ( toggle )
return $(this).attr( 'checked' ) ? '' : 'checked'; return $(this).prop( 'checked' );
else if (c) else if (c)
return 'checked'; return true;
return ''; return false;
}); });
$(this).closest('table').children('thead, tfoot').filter(':visible') $(this).closest('table').children('thead, tfoot').filter(':visible')
.children().children('.check-column').find(':checkbox') .children().children('.check-column').find(':checkbox')
.attr('checked', function() { .prop('checked', function() {
if ( toggle ) if ( toggle )
return ''; return false;
else if (c) else if (c)
return 'checked'; return true;
return ''; return false;
}); });
}); });
@ -310,7 +310,7 @@ $(document).ready( function() {
}); });
// tab in textareas // tab in textareas
$('#newcontent').keydown(function(e) { $('#newcontent').bind('keydown.wpevent_InsertTab', function(e) {
if ( e.keyCode != 9 ) if ( e.keyCode != 9 )
return true; return true;
@ -337,10 +337,10 @@ $(document).ready( function() {
e.preventDefault(); e.preventDefault();
}); });
$('#newcontent').blur(function(e) { $('#newcontent').bind('blur.wpevent_InsertTab', function(e) {
if ( this.lastKey && 9 == this.lastKey ) if ( this.lastKey && 9 == this.lastKey )
this.focus(); this.focus();
}); });
}); });
})(jQuery); })(jQuery);

File diff suppressed because one or more lines are too long

View File

@ -64,7 +64,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'utils', "/wp-admin/js/utils$suffix.js", false, '20101110' ); $scripts->add( 'utils', "/wp-admin/js/utils$suffix.js", false, '20101110' );
$scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20110510' ); $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20110520' );
$scripts->add_data( 'common', 'group', 1 ); $scripts->add_data( 'common', 'group', 1 );
$scripts->localize( 'common', 'commonL10n', array( $scripts->localize( 'common', 'commonL10n', array(
'warnDelete' => __("You are about to permanently delete the selected items.\n 'Cancel' to stop, 'OK' to delete."), 'warnDelete' => __("You are about to permanently delete the selected items.\n 'Cancel' to stop, 'OK' to delete."),