Customizer: Use a `<button>` for the collapse sidebar … button.

props afercia.
fixes #32819.
Built from https://develop.svn.wordpress.org/trunk@33153


git-svn-id: http://core.svn.wordpress.org/trunk@33125 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2015-07-10 21:22:26 +00:00
parent f0db1e0bb7
commit 75d6c10b01
21 changed files with 131 additions and 191 deletions

View File

@ -648,26 +648,6 @@ p.customize-section-description {
border-left: 1px solid #ddd; border-left: 1px solid #ddd;
} }
.collapse-sidebar {
background-color: transparent !important;
border: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0 !important;
border-radius: 0 !important;
}
.collapse-sidebar:active,
.collapse-sidebar:active .collapse-sidebar-label,
.collapse-sidebar:active .collapse-sidebar-arrow:before {
text-shadow: none;
}
.collapsed .collapse-sidebar-arrow:before {
color: #82878c;
}
/* Style for custom settings */ /* Style for custom settings */
/* /*

File diff suppressed because one or more lines are too long

View File

@ -648,26 +648,6 @@ p.customize-section-description {
border-right: 1px solid #ddd; border-right: 1px solid #ddd;
} }
.collapse-sidebar {
background-color: transparent !important;
border: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0 !important;
border-radius: 0 !important;
}
.collapse-sidebar:active,
.collapse-sidebar:active .collapse-sidebar-label,
.collapse-sidebar:active .collapse-sidebar-arrow:before {
text-shadow: none;
}
.collapsed .collapse-sidebar-arrow:before {
color: #82878c;
}
/* Style for custom settings */ /* Style for custom settings */
/* /*

File diff suppressed because one or more lines are too long

View File

@ -379,13 +379,6 @@
display: block; display: block;
} }
/* Not exactly sure what broke this, or why it works without these styles in core. */
.wp-customizer .wp-full-overlay a.collapse-sidebar {
position: fixed;
right: 0;
}
/* WARNING: The 20px factor is hard-coded in JS. */ /* WARNING: The 20px factor is hard-coded in JS. */
.menu-item-depth-0 { margin-right: 0; } .menu-item-depth-0 { margin-right: 0; }
.menu-item-depth-1 { margin-right: 20px; } .menu-item-depth-1 { margin-right: 20px; }

File diff suppressed because one or more lines are too long

View File

@ -379,13 +379,6 @@
display: block; display: block;
} }
/* Not exactly sure what broke this, or why it works without these styles in core. */
.wp-customizer .wp-full-overlay a.collapse-sidebar {
position: fixed;
left: 0;
}
/* WARNING: The 20px factor is hard-coded in JS. */ /* WARNING: The 20px factor is hard-coded in JS. */
.menu-item-depth-0 { margin-left: 0; } .menu-item-depth-0 { margin-left: 0; }
.menu-item-depth-1 { margin-left: 20px; } .menu-item-depth-1 { margin-left: 20px; }

File diff suppressed because one or more lines are too long

View File

@ -512,8 +512,6 @@
content: "\f341"; content: "\f341";
} }
.theme-overlay .theme-wrap { .theme-overlay .theme-wrap {
clear: both; clear: both;
position: fixed; position: fixed;
@ -1470,65 +1468,78 @@ body.full-overlay-active {
} }
/* Collapse Button */ /* Collapse Button */
.wp-full-overlay a.collapse-sidebar { .wp-core-ui .wp-full-overlay .collapse-sidebar {
position: absolute; position: fixed;
bottom: 12px; bottom: 8px;
right: 0; right: 10px;
z-index: 50;
display: block;
width: 19px;
height: 19px;
margin-right: 15px;
padding: 0; padding: 0;
-webkit-border-radius: 50%; color: #656a6f;
border-radius: 50%; outline: 0;
color: #777; line-height: 1;
text-decoration: none; background-color: transparent !important;
border: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0 !important;
border-radius: 0 !important;
} }
.wp-full-overlay a.collapse-sidebar:hover { .wp-core-ui .wp-full-overlay .collapse-sidebar:hover,
.wp-core-ui .wp-full-overlay .collapse-sidebar:focus {
color: #0073aa; color: #0073aa;
} }
.wp-full-overlay.collapsed .collapse-sidebar { .wp-full-overlay .collapse-sidebar-arrow,
position: absolute; .wp-full-overlay .collapse-sidebar-label {
right: 100%; display: inline-block;
vertical-align: middle;
line-height: 20px;
} }
.wp-full-overlay .collapse-sidebar-arrow { .wp-full-overlay .collapse-sidebar-arrow {
position: static; width: 20px;
margin-top: 0; height: 20px;
margin-right: 0; margin: 0 2px; /* avoid the focus box-shadow to be cut-off */
display: block; -webkit-border-radius: 50%;
width: auto; border-radius: 50%;
height: auto; overflow: hidden;
background: none; }
.wp-full-overlay .collapse-sidebar:hover .collapse-sidebar-arrow,
.wp-full-overlay .collapse-sidebar:focus .collapse-sidebar-arrow {
-webkit-box-shadow:
0 0 0 1px #5b9dd9,
0 0 2px 1px rgba(30, 140, 190, .8);
box-shadow:
0 0 0 1px #5b9dd9,
0 0 2px 1px rgba(30, 140, 190, .8);
}
.wp-full-overlay .collapse-sidebar-label {
margin-right: 3px;
}
.wp-full-overlay.collapsed .collapse-sidebar-label {
display: none;
} }
.wp-full-overlay .collapse-sidebar-arrow:before { .wp-full-overlay .collapse-sidebar-arrow:before {
-webkit-border-radius: 50%; display: block;
border-radius: 50%;
float: right;
content: "\f148"; content: "\f148";
background: #eee; background: #eee;
font: normal 20px/1 'dashicons'; font: normal 20px/1 'dashicons';
speak: none; speak: none;
display: block;
padding: 0; padding: 0;
text-indent: 0;
text-align: center;
position: relative;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
text-decoration: none !important;
} }
/* rtl:ignore */ /* rtl:ignore */
.wp-full-overlay.collapsed .collapse-sidebar-arrow:before, .wp-full-overlay.collapsed .collapse-sidebar-arrow:before,
.rtl .wp-full-overlay .collapse-sidebar-arrow:before { .rtl .wp-full-overlay .collapse-sidebar-arrow:before {
-webkit-transform: rotate(180deg); -webkit-transform: rotate(180.001deg);
-ms-transform: rotate(180deg); -ms-transform: rotate(180.001deg);
transform: rotate(180deg); transform: rotate(180.001deg); /* Firefox: promoting to its own layer to trigger anti-aliasing */
} }
.rtl .wp-full-overlay.collapsed .collapse-sidebar-arrow:before { .rtl .wp-full-overlay.collapsed .collapse-sidebar-arrow:before {
@ -1537,21 +1548,6 @@ body.full-overlay-active {
transform: none; transform: none;
} }
.wp-full-overlay.collapsed .collapse-sidebar-arrow {
background-position: -1px -109px;
}
.wp-full-overlay .collapse-sidebar-label {
position: absolute;
right: 100%;
line-height: 20px;
margin-right: 10px;
}
.wp-full-overlay.collapsed .collapse-sidebar-label {
display: none;
}
/* Animations */ /* Animations */
.wp-full-overlay, .wp-full-overlay,
.wp-full-overlay-sidebar, .wp-full-overlay-sidebar,
@ -1612,10 +1608,6 @@ body.full-overlay-active {
transition: opacity 0.3s; transition: opacity 0.3s;
} }
#customize-container .collapse-sidebar {
bottom: 16px;
}
#customize-controls { #customize-controls {
margin-top: 0; margin-top: 0;
} }

View File

@ -512,8 +512,6 @@
content: "\f345"; content: "\f345";
} }
.theme-overlay .theme-wrap { .theme-overlay .theme-wrap {
clear: both; clear: both;
position: fixed; position: fixed;
@ -1470,65 +1468,78 @@ body.full-overlay-active {
} }
/* Collapse Button */ /* Collapse Button */
.wp-full-overlay a.collapse-sidebar { .wp-core-ui .wp-full-overlay .collapse-sidebar {
position: absolute; position: fixed;
bottom: 12px; bottom: 8px;
left: 0; left: 10px;
z-index: 50;
display: block;
width: 19px;
height: 19px;
margin-left: 15px;
padding: 0; padding: 0;
-webkit-border-radius: 50%; color: #656a6f;
border-radius: 50%; outline: 0;
color: #777; line-height: 1;
text-decoration: none; background-color: transparent !important;
border: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0 !important;
border-radius: 0 !important;
} }
.wp-full-overlay a.collapse-sidebar:hover { .wp-core-ui .wp-full-overlay .collapse-sidebar:hover,
.wp-core-ui .wp-full-overlay .collapse-sidebar:focus {
color: #0073aa; color: #0073aa;
} }
.wp-full-overlay.collapsed .collapse-sidebar { .wp-full-overlay .collapse-sidebar-arrow,
position: absolute; .wp-full-overlay .collapse-sidebar-label {
left: 100%; display: inline-block;
vertical-align: middle;
line-height: 20px;
} }
.wp-full-overlay .collapse-sidebar-arrow { .wp-full-overlay .collapse-sidebar-arrow {
position: static; width: 20px;
margin-top: 0; height: 20px;
margin-left: 0; margin: 0 2px; /* avoid the focus box-shadow to be cut-off */
display: block; -webkit-border-radius: 50%;
width: auto; border-radius: 50%;
height: auto; overflow: hidden;
background: none; }
.wp-full-overlay .collapse-sidebar:hover .collapse-sidebar-arrow,
.wp-full-overlay .collapse-sidebar:focus .collapse-sidebar-arrow {
-webkit-box-shadow:
0 0 0 1px #5b9dd9,
0 0 2px 1px rgba(30, 140, 190, .8);
box-shadow:
0 0 0 1px #5b9dd9,
0 0 2px 1px rgba(30, 140, 190, .8);
}
.wp-full-overlay .collapse-sidebar-label {
margin-left: 3px;
}
.wp-full-overlay.collapsed .collapse-sidebar-label {
display: none;
} }
.wp-full-overlay .collapse-sidebar-arrow:before { .wp-full-overlay .collapse-sidebar-arrow:before {
-webkit-border-radius: 50%; display: block;
border-radius: 50%;
float: left;
content: "\f148"; content: "\f148";
background: #eee; background: #eee;
font: normal 20px/1 'dashicons'; font: normal 20px/1 'dashicons';
speak: none; speak: none;
display: block;
padding: 0; padding: 0;
text-indent: 0;
text-align: center;
position: relative;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
text-decoration: none !important;
} }
/* rtl:ignore */ /* rtl:ignore */
.wp-full-overlay.collapsed .collapse-sidebar-arrow:before, .wp-full-overlay.collapsed .collapse-sidebar-arrow:before,
.rtl .wp-full-overlay .collapse-sidebar-arrow:before { .rtl .wp-full-overlay .collapse-sidebar-arrow:before {
-webkit-transform: rotate(180deg); -webkit-transform: rotate(180.001deg);
-ms-transform: rotate(180deg); -ms-transform: rotate(180.001deg);
transform: rotate(180deg); transform: rotate(180.001deg); /* Firefox: promoting to its own layer to trigger anti-aliasing */
} }
.rtl .wp-full-overlay.collapsed .collapse-sidebar-arrow:before { .rtl .wp-full-overlay.collapsed .collapse-sidebar-arrow:before {
@ -1537,21 +1548,6 @@ body.full-overlay-active {
transform: none; transform: none;
} }
.wp-full-overlay.collapsed .collapse-sidebar-arrow {
background-position: -1px -109px;
}
.wp-full-overlay .collapse-sidebar-label {
position: absolute;
left: 100%;
line-height: 20px;
margin-left: 10px;
}
.wp-full-overlay.collapsed .collapse-sidebar-label {
display: none;
}
/* Animations */ /* Animations */
.wp-full-overlay, .wp-full-overlay,
.wp-full-overlay-sidebar, .wp-full-overlay-sidebar,
@ -1612,10 +1608,6 @@ body.full-overlay-active {
transition: opacity 0.3s; transition: opacity 0.3s;
} }
#customize-container .collapse-sidebar {
bottom: 16px;
}
#customize-controls { #customize-controls {
margin-top: 0; margin-top: 0;
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -166,10 +166,10 @@ do_action( 'customize_controls_print_scripts' );
</div> </div>
<div id="customize-footer-actions" class="wp-full-overlay-footer"> <div id="customize-footer-actions" class="wp-full-overlay-footer">
<a href="#" class="collapse-sidebar button-secondary" title="<?php esc_attr_e('Collapse Sidebar'); ?>"> <button type="button" class="collapse-sidebar button-secondary" aria-expanded="true" aria-label="<?php esc_attr_e( 'Collapse Sidebar' ); ?>">
<span class="collapse-sidebar-arrow"></span> <span class="collapse-sidebar-arrow"></span>
<span class="collapse-sidebar-label"><?php _e('Collapse'); ?></span> <span class="collapse-sidebar-label"><?php _e( 'Collapse' ); ?></span>
</a> </button>
</div> </div>
</form> </form>
<div id="customize-preview" class="wp-full-overlay-main"></div> <div id="customize-preview" class="wp-full-overlay-main"></div>

View File

@ -328,10 +328,10 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
<div class="install-theme-info"></div> <div class="install-theme-info"></div>
</div> </div>
<div class="wp-full-overlay-footer"> <div class="wp-full-overlay-footer">
<a href="#" class="collapse-sidebar" title="<?php esc_attr_e('Collapse Sidebar'); ?>"> <button type="button" class="collapse-sidebar button-secondary" aria-expanded="true" aria-label="<?php esc_attr_e( 'Collapse Sidebar' ); ?>">
<span class="collapse-sidebar-label"><?php _e('Collapse'); ?></span>
<span class="collapse-sidebar-arrow"></span> <span class="collapse-sidebar-arrow"></span>
</a> <span class="collapse-sidebar-label"><?php _e( 'Collapse' ); ?></span>
</button>
</div> </div>
</div> </div>
<div class="wp-full-overlay-main"></div> <div class="wp-full-overlay-main"></div>

View File

@ -3086,13 +3086,14 @@
event.preventDefault(); event.preventDefault();
}); });
$('.collapse-sidebar').on( 'click keydown', function( event ) { $( '.collapse-sidebar' ).on( 'click', function() {
if ( api.utils.isKeydownButNotEnterEvent( event ) ) { if ( 'true' === $( this ).attr( 'aria-expanded' ) ) {
return; $( this ).attr({ 'aria-expanded': 'false', 'aria-label': api.l10n.expandSidebar });
} else {
$( this ).attr({ 'aria-expanded': 'true', 'aria-label': api.l10n.collapseSidebar });
} }
overlay.toggleClass( 'collapsed' ).toggleClass( 'expanded' ); overlay.toggleClass( 'collapsed' ).toggleClass( 'expanded' );
event.preventDefault();
}); });
$( '.customize-controls-preview-toggle' ).on( 'click keydown', function( event ) { $( '.customize-controls-preview-toggle' ).on( 'click keydown', function( event ) {

File diff suppressed because one or more lines are too long

View File

@ -793,7 +793,13 @@ themes.view.Preview = themes.view.Details.extend({
return false; return false;
}, },
collapse: function() { collapse: function( event ) {
var $button = $( event.currentTarget );
if ( 'true' === $button.attr( 'aria-expanded' ) ) {
$button.attr({ 'aria-expanded': 'false', 'aria-label': l10n.expandSidebar });
} else {
$button.attr({ 'aria-expanded': 'true', 'aria-label': l10n.collapseSidebar });
}
this.$el.toggleClass( 'collapsed' ).toggleClass( 'expanded' ); this.$el.toggleClass( 'collapsed' ).toggleClass( 'expanded' );
return false; return false;

File diff suppressed because one or more lines are too long

View File

@ -51,6 +51,8 @@ wp_localize_script( 'theme', '_wpThemeSettings', array(
'error' => __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ), 'error' => __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ),
'themesFound' => __( 'Number of Themes found: %d' ), 'themesFound' => __( 'Number of Themes found: %d' ),
'noThemesFound' => __( 'No themes found. Try a different search.' ), 'noThemesFound' => __( 'No themes found. Try a different search.' ),
'collapseSidebar' => __( 'Collapse Sidebar' ),
'expandSidebar' => __( 'Expand Sidebar' ),
), ),
'installedThemes' => array_keys( $installed_themes ), 'installedThemes' => array_keys( $installed_themes ),
) ); ) );
@ -252,10 +254,10 @@ if ( $tab ) {
</div> </div>
</div> </div>
<div class="wp-full-overlay-footer"> <div class="wp-full-overlay-footer">
<a href="#" class="collapse-sidebar" title="<?php esc_attr_e( 'Collapse Sidebar' ); ?>"> <button type="button" class="collapse-sidebar button-secondary" aria-expanded="true" aria-label="<?php esc_attr_e( 'Collapse Sidebar' ); ?>">
<span class="collapse-sidebar-label"><?php _e( 'Collapse' ); ?></span>
<span class="collapse-sidebar-arrow"></span> <span class="collapse-sidebar-arrow"></span>
</a> <span class="collapse-sidebar-label"><?php _e( 'Collapse' ); ?></span>
</button>
</div> </div>
</div> </div>
<div class="wp-full-overlay-main"> <div class="wp-full-overlay-main">

View File

@ -419,9 +419,10 @@ function wp_default_scripts( &$scripts ) {
'cheatin' => __( 'Cheatin&#8217; uh?' ), 'cheatin' => __( 'Cheatin&#8217; uh?' ),
'previewIframeTitle' => __( 'Site Preview' ), 'previewIframeTitle' => __( 'Site Preview' ),
'loginIframeTitle' => __( 'Session expired' ), 'loginIframeTitle' => __( 'Session expired' ),
'collapseSidebar' => __( 'Collapse Sidebar' ),
'expandSidebar' => __( 'Expand Sidebar' ),
// Used for overriding the file types allowed in plupload. // Used for overriding the file types allowed in plupload.
'allowedFiles' => __( 'Allowed Files' ), 'allowedFiles' => __( 'Allowed Files' ),
) ); ) );
$scripts->add( 'customize-widgets', "/wp-admin/js/customize-widgets$suffix.js", array( 'jquery', 'jquery-ui-sortable', 'jquery-ui-droppable', 'wp-backbone', 'customize-controls' ), false, 1 ); $scripts->add( 'customize-widgets', "/wp-admin/js/customize-widgets$suffix.js", array( 'jquery', 'jquery-ui-sortable', 'jquery-ui-droppable', 'wp-backbone', 'customize-controls' ), false, 1 );

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.3-beta2-33152'; $wp_version = '4.3-beta2-33153';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.