Changeset 48460
- Timestamp:
- 07/13/2020 06:01:31 PM (4 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/admin/postbox.js
r48373 r48460 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' ); 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 } 216 230 217 231 // Set an aria-disabled=true attribute on the first visible "move" buttons. -
trunk/src/wp-admin/css/common.css
r48418 r48460 2012 2012 } 2013 2013 2014 /* Post box order and toggle buttons. */ 2014 2015 .postbox .handle-order-higher, 2015 2016 .postbox .handle-order-lower, … … 2027 2028 .postbox .handle-order-lower { 2028 2029 color: #72777c; 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 2029 2038 } 2030 2039
Note: See TracChangeset
for help on using the changeset viewer.