Changeset 38981
- Timestamp:
- 10/27/2016 03:22:52 PM (8 years ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/css/nav-menus.css
r38912 r38981 694 694 695 695 .add-menu-item-pagelinks { 696 margin: .5em auto;696 margin: .5em -10px; 697 697 text-align: center; 698 } 699 700 .add-menu-item-pagelinks .page-numbers { 701 display: inline-block; 702 min-width: 20px; 703 } 704 705 .add-menu-item-pagelinks .page-numbers.dots { 706 min-width: 0; 698 707 } 699 708 -
trunk/src/wp-admin/includes/nav-menu.php
r38754 r38981 359 359 ), 360 360 'format' => '', 361 'prev_text' => __('«'), 362 'next_text' => __('»'), 363 'total' => $num_pages, 361 'prev_text' => '<span aria-label="' . esc_attr__( 'Previous page' ) . '">' . __( '«' ) . '</span>', 362 'next_text' => '<span aria-label="' . esc_attr__( 'Next page' ) . '">' . __( '»' ) . '</span>', 363 'before_page_number' => '<span class="screen-reader-text">' . __( 'Page' ) . '</span> ', 364 'total' => $num_pages, 364 365 'current' => $pagenum 365 366 )); … … 643 644 ), 644 645 'format' => '', 645 'prev_text' => __('«'), 646 'next_text' => __('»'), 647 'total' => $num_pages, 646 'prev_text' => '<span aria-label="' . esc_attr__( 'Previous page' ) . '">' . __( '«' ) . '</span>', 647 'next_text' => '<span aria-label="' . esc_attr__( 'Next page' ) . '">' . __( '»' ) . '</span>', 648 'before_page_number' => '<span class="screen-reader-text">' . __( 'Page' ) . '</span> ', 649 'total' => $num_pages, 648 650 'current' => $pagenum 649 651 )); -
trunk/src/wp-admin/js/nav-menu.js
r38799 r38981 1090 1090 $('#' + e.target.id.replace(/submit-/, '')).addSelectedToMenu( api.addMenuItemToBottom ); 1091 1091 return false; 1092 } else if ( target.hasClass('page-numbers') ) { 1093 $.post( ajaxurl, e.target.href.replace(/.*\?/, '').replace(/action=([^&]*)/, '') + '&action=menu-get-metabox', 1094 function( resp ) { 1095 if ( -1 == resp.indexOf('replace-id') ) 1096 return; 1097 1098 var metaBoxData = $.parseJSON(resp), 1099 toReplace = document.getElementById(metaBoxData['replace-id']), 1100 placeholder = document.createElement('div'), 1101 wrap = document.createElement('div'); 1102 1103 if ( ! metaBoxData.markup || ! toReplace ) 1104 return; 1105 1106 wrap.innerHTML = metaBoxData.markup ? metaBoxData.markup : ''; 1107 1108 toReplace.parentNode.insertBefore( placeholder, toReplace ); 1109 placeholder.parentNode.removeChild( toReplace ); 1110 1111 placeholder.parentNode.insertBefore( wrap, placeholder ); 1112 1113 placeholder.parentNode.removeChild( placeholder ); 1114 1092 } 1093 }); 1094 1095 /* 1096 * Delegate the `click` event and attach it just to the pagination 1097 * links thus excluding the current page `<span>`. See ticket #35577. 1098 */ 1099 $( '#nav-menu-meta' ).on( 'click', 'a.page-numbers', function() { 1100 var $container = $( this ).closest( '.inside' ); 1101 1102 $.post( ajaxurl, this.href.replace( /.*\?/, '' ).replace( /action=([^&]*)/, '' ) + '&action=menu-get-metabox', 1103 function( resp ) { 1104 var metaBoxData = $.parseJSON( resp ), 1105 toReplace; 1106 1107 if ( -1 === resp.indexOf( 'replace-id' ) ) { 1108 return; 1115 1109 } 1116 ); 1117 1118 return false; 1119 } 1110 1111 // Get the post type menu meta box to update. 1112 toReplace = document.getElementById( metaBoxData['replace-id'] ); 1113 1114 if ( ! metaBoxData.markup || ! toReplace ) { 1115 return; 1116 } 1117 1118 // Update the post type menu meta box with new content from the response. 1119 $container.html( metaBoxData.markup ); 1120 } 1121 ); 1122 1123 return false; 1120 1124 }); 1121 1125 },
Note: See TracChangeset
for help on using the changeset viewer.