Ticket #39074: 39074.12.diff
| File 39074.12.diff, 2.8 KB (added by , 6 years ago) |
|---|
-
src/js/_enqueues/admin/postbox.js
203 203 * @return {void} 204 204 */ 205 205 updateOrderButtonsProperties: function() { 206 var firstSortablesId = $( '.meta-box-sortables: first' ).attr( 'id' ),207 lastSortablesId = $( '.meta-box-sortables: last' ).attr( 'id' ),206 var firstSortablesId = $( '.meta-box-sortables:visible:first' ).attr( 'id' ), 207 lastSortablesId = $( '.meta-box-sortables:visible:last' ).attr( 'id' ), 208 208 firstPostbox = $( '.postbox:visible:first' ), 209 209 lastPostbox = $( '.postbox:visible:last' ), 210 firstPostboxId = firstPostbox.attr( 'id' ), 211 lastPostboxId = lastPostbox.attr( 'id' ), 210 212 firstPostboxSortablesId = firstPostbox.closest( '.meta-box-sortables' ).attr( 'id' ), 211 lastPostboxSortablesId = lastPostbox.closest( '.meta-box-sortables' ).attr( 'id' ); 213 lastPostboxSortablesId = lastPostbox.closest( '.meta-box-sortables' ).attr( 'id' ), 214 moveUpButtons = $( '.handle-order-higher' ), 215 moveDownButtons = $( '.handle-order-lower' ); 212 216 213 217 // Enable all buttons as a reset first. 214 $( '.handle-order-higher' ).attr( 'aria-disabled', 'false' ); 215 $( '.handle-order-lower' ).attr( 'aria-disabled', 'false' ); 218 moveUpButtons 219 .attr( 'aria-disabled', 'false' ) 220 .removeClass( 'hidden' ); 221 moveDownButtons 222 .attr( 'aria-disabled', 'false' ) 223 .removeClass( 'hidden' ); 216 224 225 // When there's only one "sortables" area (e.g. in the block editor) and only one visible postbox, hide the buttons. 226 if ( firstSortablesId === lastSortablesId && firstPostboxId === lastPostboxId ) { 227 moveUpButtons.addClass( 'hidden' ); 228 moveDownButtons.addClass( 'hidden' ); 229 } 230 217 231 // Set an aria-disabled=true attribute on the first visible "move" buttons. 218 232 if ( firstSortablesId === firstPostboxSortablesId ) { 219 233 $( firstPostbox ).find( '.handle-order-higher' ).attr( 'aria-disabled', 'true' ); -
src/wp-admin/css/common.css
2011 2011 flex-shrink: 0; 2012 2012 } 2013 2013 2014 /* Post box order and toggle buttons. */ 2014 2015 .postbox .handle-order-higher, 2015 2016 .postbox .handle-order-lower, 2016 2017 .postbox .handlediv { … … 2028 2029 color: #72777c; 2029 2030 } 2030 2031 2032 /* Post box order buttons in the block editor meta boxes area. */ 2033 .edit-post-meta-boxes-area .postbox .handle-order-higher, 2034 .edit-post-meta-boxes-area .postbox .handle-order-lower { 2035 width: 44px; 2036 height: 44px; 2037 color: #191e23 2038 } 2039 2031 2040 .postbox .handle-order-higher[aria-disabled="true"], 2032 2041 .postbox .handle-order-lower[aria-disabled="true"] { 2033 2042 cursor: default;