Ticket #21283: 21283.5.diff
File 21283.5.diff, 9.1 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
70 70 <div id="customize-header-actions" class="wp-full-overlay-header"> 71 71 <?php 72 72 $save_text = $wp_customize->is_theme_active() ? __( 'Save & Publish' ) : __( 'Save & Activate' ); 73 submit_button( $save_text, 'primary ', 'save', false );73 submit_button( $save_text, 'primary save', 'save', false ); 74 74 ?> 75 75 <span class="spinner"></span> 76 76 <a class="back button" href="<?php echo esc_url( $return ? $return : admin_url( 'themes.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>' ); … … 113 113 </div> 114 114 115 115 <div id="customize-footer-actions" class="wp-full-overlay-footer"> 116 <?php 117 $save_text = $wp_customize->is_theme_active() ? __( 'Save & Publish' ) : __( 'Save & Activate' ); 118 submit_button( $save_text, 'primary save', 'save', false ); 119 ?> 120 <span class="spinner"></span> 121 <a class="back button" href="<?php echo esc_url( $return ? $return : admin_url( 'themes.php' ) ); ?>"> 122 <?php _e( 'Cancel' ); ?> 123 </a> 124 116 125 <a href="#" class="collapse-sidebar button-secondary" title="<?php esc_attr_e('Collapse Sidebar'); ?>"> 117 126 <span class="collapse-sidebar-arrow"></span> 118 127 <span class="collapse-sidebar-label"><?php _e('Collapse'); ?></span> -
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 … … 774 788 activated = state.create('activated'); 775 789 776 790 state.bind( 'change', function() { 777 var save = $(' #save'),791 var save = $('.save'), 778 792 back = $('.back'); 779 793 780 794 if ( ! activated() ) { … … 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' ); … … 826 855 }); 827 856 828 857 // Button bindings. 829 $(' #save').click( function( event ) {858 $('.save').click( function( event ) { 830 859 previewer.save(); 831 860 event.preventDefault(); 861 }).keydown( function( event ) { 862 if ( 9 === event.which ) // tab 863 return; 864 if ( 13 === event.which ) // enter 865 previewer.save(); 866 event.preventDefault(); 832 867 }); 868 869 $('.back').keydown( function( event ) { 870 if ( 9 === event.which ) // tab 871 return; 872 var thisHref = $(this).attr('href'); 873 if ( 13 === event.which ) // enter 874 window.location = thisHref; 875 event.preventDefault(); 876 }); 833 877 834 878 $('.collapse-sidebar').click( function( event ) { 835 879 overlay.toggleClass( 'collapsed' ).toggleClass( 'expanded' ); … … 948 992 }); 949 993 950 994 api.trigger( 'ready' ); 995 996 // Make sure left column gets focus 997 var topBackButton = $('#customize-header-actions .back'); 998 topBackButton.focus(); 999 setTimeout(function () { 1000 topBackButton.focus(); 1001 }, 800); 1002 951 1003 }); 952 1004 953 1005 })( wp, jQuery ); 1006 No newline at end of file -
wp-admin/css/wp-admin.css
5455 5455 margin: 0; 5456 5456 } 5457 5457 5458 .wp-full-overlay-sidebar .wp-full-overlay-footer { 5459 height: 80px; 5460 } 5461 5458 5462 .wp-full-overlay-sidebar .wp-full-overlay-header { 5459 5463 top: 0; 5460 5464 border-top: 0; … … 5472 5476 .wp-full-overlay-sidebar .wp-full-overlay-sidebar-content { 5473 5477 position: absolute; 5474 5478 top: 45px; 5475 bottom: 45px;5479 bottom: 80px; 5476 5480 left: 0; 5477 5481 right: 0; 5478 5482 overflow: auto; -
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; … … 155 166 margin: 0; 156 167 } 157 168 169 #customize-footer-actions .button-primary, 158 170 #customize-header-actions .button-primary { 159 171 float: right; 160 172 margin-top: 10px; 161 173 } 162 174 175 #customize-footer-actions .spinner, 163 176 #customize-header-actions .spinner { 164 177 margin-top: 16px; 165 178 margin-right: 4px; 166 179 } 167 180 181 .saving #customize-footer-actions .spinner, 168 182 .saving #customize-header-actions .spinner { 169 183 display: block; 170 184 }