Ticket #21283: 21283.3.diff
File 21283.3.diff, 6.6 KB (added by , 12 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
521 521 <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> 522 522 523 523 <div class="customize-control-content"> 524 <div class="dropdown preview-thumbnail" >524 <div class="dropdown preview-thumbnail" tabindex="0"> 525 525 <div class="dropdown-content"> 526 526 <?php if ( empty( $src ) ): ?> 527 527 <img style="display:none;" /> … … 537 537 <div class="library"> 538 538 <ul> 539 539 <?php foreach ( $this->tabs as $id => $tab ): ?> 540 <li data-customize-tab='<?php echo esc_attr( $id ); ?>' >540 <li data-customize-tab='<?php echo esc_attr( $id ); ?>' tabindex='0'> 541 541 <?php echo esc_html( $tab['label'] ); ?> 542 542 </li> 543 543 <?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 ); … … 210 220 }); 211 221 212 222 // Bind tab switch events 213 this.library.children('ul').on( 'click', 'li', function( event ) { 223 this.library.children('ul').on( 'click keydown', 'li', function( event ) { 224 225 if ( event.type === 'keydown' && 13 !== event.which ) 226 return; 227 214 228 var id = $(this).data('customizeTab'), 215 229 tab = control.tabs[ id ]; 216 230 … … 814 828 }()); 815 829 816 830 // Temporary accordion code. 817 $('.customize-section-title').click( function( event ) { 831 var accordianFrozen = false; 832 $('.customize-section-title').bind('click keydown', function( event ) { 833 834 if ( event.type === 'keydown' && 13 !== event.which ) // enter 835 return; 836 818 837 var clicked = $( this ).parents( '.customize-section' ); 819 838 820 if ( clicked.hasClass('cannot-expand') )839 if ( clicked.hasClass('cannot-expand') || accordianFrozen ) 821 840 return; 841 842 // Don't want to fire focus and click at same time 843 accordianFrozen = true; 844 setTimeout(function () { 845 accordianFrozen = false; 846 }, 400); 847 848 // Scroll up if on #customize-section-title_tagline 849 if ('customize-section-title_tagline' === clicked.attr('id')) 850 $('.wp-full-overlay-sidebar-content').scrollTop(0); 822 851 823 852 $( '.customize-section' ).not( clicked ).removeClass( 'open' ); 824 853 clicked.toggleClass( 'open' ); … … 829 858 $('#save').click( function( event ) { 830 859 previewer.save(); 831 860 event.preventDefault(); 861 }).keydown( function( event ) { 862 if ( 13 === event.which ) // enter 863 previewer.save(); 864 event.preventDefault(); 832 865 }); 866 867 $('.back').keydown( function( event ) { 868 if ( 9 === event.which ) // tab 869 return; 870 var thisHref = $(this).attr('href'); 871 if ( 13 === event.which ) // enter 872 window.location = thisHref; 873 event.preventDefault(); 874 }); 833 875 834 876 $('.collapse-sidebar').click( function( event ) { 835 877 overlay.toggleClass( 'collapsed' ).toggleClass( 'expanded' ); … … 948 990 }); 949 991 950 992 api.trigger( 'ready' ); 993 994 // Make sure left column gets focus 995 $('.back').focus(); 996 setTimeout(function () { 997 $('.back').focus(); 998 }, 800); 999 951 1000 }); 952 1001 953 1002 })( wp, jQuery ); 1003 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;