Ticket #31634: 31634.3.diff
File 31634.3.diff, 4.2 KB (added by , 9 years ago) |
---|
-
src/wp-admin/includes/class-wp-list-table.php
436 436 return; 437 437 438 438 echo "<label for='bulk-action-selector-" . esc_attr( $which ) . "' class='screen-reader-text'>" . __( 'Select bulk action' ) . "</label>"; 439 echo "<select name='action$two' id='bulk-action-selector-" . esc_attr( $which ) . "' >\n";440 echo "<option value='-1' selected='selected'>" . __( 'Bulk Actions' ) . "</option>\n";439 echo "<select name='action$two' id='bulk-action-selector-" . esc_attr( $which ) . "' disabled='disabled'>\n"; 440 echo "<option value='-1'>" . __( 'Bulk Actions' ) . "</option>\n"; 441 441 442 442 foreach ( $this->_actions as $name => $title ) { 443 443 $class = 'edit' == $name ? ' class="hide-if-no-js"' : ''; … … 447 447 448 448 echo "</select>\n"; 449 449 450 submit_button( __( 'Apply' ), 'action', '', false, array( 'id' => "doaction$two" ) );450 submit_button( __( 'Apply' ), 'action', '', false, array( 'id' => "doaction$two", 'disabled' => 'disabled' ) ); 451 451 echo "\n"; 452 452 } 453 453 -
src/wp-admin/includes/update-core.php
279 279 'wp-admin/images/logo-login.gif', 280 280 'wp-admin/images/star.gif', 281 281 'wp-admin/js/list-table.dev.js', 282 'wp-admin/js/list-table.js', 282 //'wp-admin/js/list-table.js', // restored in 4.4 283 283 'wp-includes/default-embeds.php', 284 284 'wp-includes/js/tinymce/plugins/wordpress/img/help.gif', 285 285 'wp-includes/js/tinymce/plugins/wordpress/img/more.gif', -
src/wp-admin/js/list-table.js
1 /*globals jQuery */ 2 3 (function ($) { 4 "use strict"; 5 6 var listTable, 7 actions, 8 doActions; 9 10 function getChecked() { 11 return listTable.find('table .check-column input[type="checkbox"]:checked' ); 12 } 13 14 /** 15 * Enable and Disable Apply button in wp-list 16 * 17 * @param {jQuery.Event} e 18 */ 19 function setApplyButton( e ) { 20 var checked = getChecked().length; 21 22 if ( 'SELECT' === e.target.tagName ) { 23 actions.val( e.target.value ); 24 } 25 26 actions.prop( 'disabled', ! checked ); 27 doActions.prop( 'disabled', ! checked || -1 === parseInt( actions.val(), 10 ) ); 28 } 29 30 $(document).ready(function () { 31 listTable = $('.wp-list-table').closest('form'); 32 if ( ! listTable.length ) { 33 return; 34 } 35 36 actions = listTable.find( 'select[name="action"], select[name="action2"]' ) 37 .on( 'change', setApplyButton ); 38 39 doActions = listTable.find( '#doaction, #doaction2' ); 40 41 listTable.find( 'table' ).on( 'click', '.check-column :checkbox', setApplyButton ); 42 }); 43 44 }(jQuery)); 45 No newline at end of file -
src/wp-includes/script-loader.php
77 77 'secure' => (string) ( 'https' === parse_url( site_url(), PHP_URL_SCHEME ) ), 78 78 ) ); 79 79 80 $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils' ), false, 1 );80 $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils', 'list-table'), false, 1 ); 81 81 did_action( 'init' ) && $scripts->localize( 'common', 'commonL10n', array( 82 82 'warnDelete' => __( "You are about to permanently delete the selected items.\n 'Cancel' to stop, 'OK' to delete." ), 83 83 'dismiss' => __( 'Dismiss this notice.' ), … … 396 396 397 397 $scripts->add( 'user-suggest', "/wp-admin/js/user-suggest$suffix.js", array( 'jquery-ui-autocomplete' ), false, 1 ); 398 398 399 $scripts->add( 'list-table', "/wp-admin/js/list-table$suffix.js", array( 'jquery' ), false, 1 ); 400 399 401 $scripts->add( 'admin-bar', "/wp-includes/js/admin-bar$suffix.js", array(), false, 1 ); 400 402 401 403 $scripts->add( 'wplink', "/wp-includes/js/wplink$suffix.js", array( 'jquery' ), false, 1 );