Ticket #21283: 21283.2.diff
File 21283.2.diff, 6.5 KB (added by , 13 years ago) |
---|
-
wp-includes/class-wp-customize-section.php
80 80 protected function render() { 81 81 ?> 82 82 <li id="customize-section-<?php echo esc_attr( $this->id ); ?>" class="control-section customize-section"> 83 <h3 class="customize-section-title" t itle="<?php echo esc_attr( $this->description ); ?>"><?php echo esc_html( $this->title ); ?></h3>83 <h3 class="customize-section-title" tabindex="0" title="<?php echo esc_attr( $this->description ); ?>"><?php echo esc_html( $this->title ); ?></h3> 84 84 <ul class="customize-section-content"> 85 85 <?php 86 86 foreach ( $this->controls as $control ) -
wp-includes/class-wp-customize-control.php
520 520 <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> 521 521 522 522 <div class="customize-control-content"> 523 <div class="dropdown preview-thumbnail" >523 <div class="dropdown preview-thumbnail" tabindex="0"> 524 524 <div class="dropdown-content"> 525 525 <?php if ( empty( $src ) ): ?> 526 526 <img style="display:none;" /> … … 536 536 <div class="library"> 537 537 <ul> 538 538 <?php foreach ( $this->tabs as $id => $tab ): ?> 539 <li data-customize-tab='<?php echo esc_attr( $id ); ?>' >539 <li data-customize-tab='<?php echo esc_attr( $id ); ?>' tabindex='0'> 540 540 <?php echo esc_html( $tab['label'] ); ?> 541 541 </li> 542 542 <?php endforeach; ?> -
wp-admin/customize.php
83 83 $cannot_expand = ! ( $screenshot || $wp_customize->theme()->get('Description') ); 84 84 ?> 85 85 86 <div class="wp-full-overlay-sidebar-content" >86 <div class="wp-full-overlay-sidebar-content" tabindex="-1"> 87 87 <div id="customize-info" class="customize-section<?php if ( $cannot_expand ) echo ' cannot-expand'; ?>"> 88 <div class="customize-section-title" >88 <div class="customize-section-title" tabindex="0"> 89 89 <span class="preview-notice"><?php 90 90 /* translators: %s is the theme name in the Customize/Live Preview pane */ 91 91 echo sprintf( __( 'You are previewing %s' ), '<strong class="theme-name">' . $wp_customize->theme()->display('Name') . '</strong>' ); -
wp-admin/js/customize-controls.js
94 94 else 95 95 statuses.hide(); 96 96 }; 97 97 98 var toggleFreeze = false; 99 98 100 // Support the .dropdown class to open/close complex elements 99 this.container.on( 'click ', '.dropdown', function( event ) {101 this.container.on( 'click focus', '.dropdown', function( event ) { 100 102 event.preventDefault(); 101 control.container.toggleClass('open'); 103 104 if (!toggleFreeze) 105 control.container.toggleClass('open'); 106 107 // Don't want to fire focus and click at same time 108 toggleFreeze = true; 109 setTimeout(function () { 110 toggleFreeze = false; 111 }, 400); 102 112 }); 103 113 104 114 this.setting.bind( update ); … … 221 231 }); 222 232 223 233 // Bind tab switch events 224 this.library.children('ul').on( 'click', 'li', function( event ) { 234 this.library.children('ul').on( 'click keydown', 'li', function( event ) { 235 236 if ( event.type === 'keydown' && 13 !== event.which ) 237 return; 238 225 239 var id = $(this).data('customizeTab'), 226 240 tab = control.tabs[ id ]; 227 241 … … 824 838 }()); 825 839 826 840 // Temporary accordion code. 827 $('.customize-section-title').click( function( event ) { 841 var accordianFrozen = false; 842 $('.customize-section-title').bind('click focus', function( event ) { 828 843 var clicked = $( this ).parents( '.customize-section' ); 829 844 830 if ( clicked.hasClass('cannot-expand') )845 if ( clicked.hasClass('cannot-expand') || accordianFrozen ) 831 846 return; 847 848 // Don't want to fire focus and click at same time 849 accordianFrozen = true; 850 setTimeout(function () { 851 accordianFrozen = false; 852 }, 400); 853 854 // Scroll up if on #customize-section-title_tagline 855 if ('customize-section-title_tagline' === clicked.attr('id')) 856 $('.wp-full-overlay-sidebar-content').scrollTop(0); 832 857 833 858 $( '.customize-section' ).not( clicked ).removeClass( 'open' ); 834 859 clicked.toggleClass( 'open' ); … … 839 864 $('#save').click( function( event ) { 840 865 previewer.save(); 841 866 event.preventDefault(); 867 }).keydown( function( event ) { 868 if ( 13 === event.which ) // enter 869 previewer.save(); 870 event.preventDefault(); 842 871 }); 872 873 $('.back').keydown( function( event ) { 874 if ( 9 === event.which ) // tab 875 return; 876 var thisHref = $(this).attr('href'); 877 if ( 13 === event.which ) // enter 878 window.location = thisHref; 879 event.preventDefault(); 880 }); 843 881 844 882 $('.collapse-sidebar').click( function( event ) { 845 883 overlay.toggleClass( 'collapsed' ).toggleClass( 'expanded' ); … … 958 996 }); 959 997 960 998 api.trigger( 'ready' ); 999 1000 // Make sure left column gets focus 1001 $('.back').focus(); 1002 setTimeout(function () { 1003 $('.back').focus(); 1004 }, 800); 1005 961 1006 }); 962 1007 963 1008 })( wp, jQuery ); 1009 No newline at end of file -
wp-admin/css/customize-controls.css
67 67 68 68 .control-section:hover .customize-section-title, 69 69 .control-section .customize-section-title:hover, 70 .control-section.open .customize-section-title { 70 .control-section.open .customize-section-title, 71 .customize-section-title:focus { 71 72 color: #fff; 72 73 text-shadow: 0 -1px 0 #333; 73 74 background: #808080; … … 126 127 color: #999; 127 128 } 128 129 130 #customize-info .customize-section-title:focus .preview-notice { 131 color: #ccc; 132 text-shadow: 0 -1px 0 #333; 133 } 134 129 135 #customize-info .theme-name { 130 136 font-size: 20px; 131 137 font-weight: 200; … … 135 141 text-shadow: 0 1px 0 #fff; 136 142 } 137 143 144 #customize-info .customize-section-title:focus .theme-name { 145 color: #fff; 146 text-shadow: 0 -1px 0 #333; 147 } 148 138 149 #customize-info .theme-screenshot { 139 150 width: 258px; 140 151 border: 1px solid #ccc;