Ticket #36903: 36903.patch
File 36903.patch, 4.4 KB (added by , 9 years ago) |
---|
-
src/wp-admin/css/customize-controls.css
1420 1420 1421 1421 #available-widgets-filter input, 1422 1422 #available-menu-items-search input { 1423 width: 100%; 1423 1424 padding: 6px 10px; 1424 width: 100%;1425 line-height: 1.14285714; /* 16 desired line height / 14 font size. Keep 8 decimals for same cross browser rounding */ 1425 1426 } 1426 1427 1427 1428 #available-widgets .widget-top, -
src/wp-admin/css/customize-nav-menus.css
607 607 608 608 #available-menu-items-search .clear-results { 609 609 position: absolute; 610 top: 20px;610 top: 18px; /* 12 container padding +1 input margin +1 input border +4 ( ( 28 input height - 20 button height ) / 2 ) */ 611 611 right: 20px; 612 612 width: 20px; 613 613 height: 20px; 614 padding: 0; 615 border: 0; 614 616 cursor: pointer; 617 background: none; 615 618 color: #a00; 616 619 text-decoration: none; 620 outline: 0; 617 621 } 618 622 619 623 #available-menu-items-search .clear-results, … … 625 629 display: block; 626 630 } 627 631 632 .ie8 #available-menu-items-search.loading .clear-results:before { 633 content: ""; /* help IE8 redraw the pseudo element */ 634 } 635 628 636 #available-menu-items-search .clear-results:before { 629 637 content: "\f335"; 630 638 font: normal 20px/1 dashicons; 639 vertical-align: middle; 631 640 -webkit-font-smoothing: antialiased; 632 641 -moz-osx-font-smoothing: grayscale; 633 642 } … … 639 648 640 649 #available-menu-items-search .spinner { 641 650 position: absolute; 642 top: 20px; 651 top: 18px; /* 12 container padding +1 input margin +1 input border +4 ( ( 28 input height - 20 button height ) / 2 ) */ 652 right: 20px; 643 653 margin: 0 !important; 644 right: 20px;645 654 } 646 655 647 656 /* search results list */ -
src/wp-admin/js/customize-nav-menus.js
142 142 } ); 143 143 144 144 // Clear the search results. 145 $( '.clear-results' ).on( 'click keydown', function( event ) { 146 if ( event.type === 'keydown' && ( 13 !== event.which && 32 !== event.which ) ) { // "return" or "space" keys only 147 return; 148 } 149 150 event.preventDefault(); 151 152 $( '#menu-items-search' ).val( '' ).focus(); 153 event.target.value = ''; 154 self.search( event ); 145 $( '.clear-results' ).on( 'click', function() { 146 self.$search.val( '' ).focus().trigger( 'keyup' ); 155 147 } ); 156 148 157 149 this.$el.on( 'input', '#custom-menu-item-name.invalid, #custom-menu-item-url.invalid', function() { … … 208 200 $otherSections.fadeOut( 100 ); 209 201 $searchSection.find( '.accordion-section-content' ).slideDown( 'fast' ); 210 202 $searchSection.addClass( 'open' ); 211 $searchSection.find( '.clear-results' ) 212 .prop( 'tabIndex', 0 ) 213 .addClass( 'is-visible' ); 203 $searchSection.find( '.clear-results' ).addClass( 'is-visible' ); 214 204 } else if ( '' === event.target.value ) { 215 205 $searchSection.removeClass( 'open' ); 216 206 $otherSections.show(); 217 $searchSection.find( '.clear-results' ) 218 .prop( 'tabIndex', -1 ) 219 .removeClass( 'is-visible' ); 207 $searchSection.find( '.clear-results' ).removeClass( 'is-visible' ); 220 208 } 221 209 222 210 this.searchTerm = event.target.value; -
src/wp-includes/class-wp-customize-nav-menus.php
761 761 <input type="text" id="menu-items-search" placeholder="<?php esc_attr_e( 'Search menu items…' ) ?>" aria-describedby="menu-items-search-desc" /> 762 762 <p class="screen-reader-text" id="menu-items-search-desc"><?php _e( 'The search results will be updated as you type.' ); ?></p> 763 763 <span class="spinner"></span> 764 <span class="clear-results"><span class="screen-reader-text"><?php _e( 'Clear Results' ); ?></span></span>765 764 </div> 765 <button type="button" class="clear-results"><span class="screen-reader-text"><?php _e( 'Clear Results' ); ?></span></button> 766 766 <ul class="accordion-section-content" data-type="search"></ul> 767 767 </div> 768 768 <div id="new-custom-menu-item" class="accordion-section">