From 0730240b9a360c25955e5cfd77dea18c56468925 Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Fri, 10 Jul 2015 21:21:07 +0000 Subject: [PATCH] =?UTF-8?q?Customizer:=20Use=20a=20`
diff --git a/src/wp-admin/includes/class-wp-theme-install-list-table.php b/src/wp-admin/includes/class-wp-theme-install-list-table.php index da4ed275d9..427c539148 100644 --- a/src/wp-admin/includes/class-wp-theme-install-list-table.php +++ b/src/wp-admin/includes/class-wp-theme-install-list-table.php @@ -328,10 +328,10 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
diff --git a/src/wp-admin/js/customize-controls.js b/src/wp-admin/js/customize-controls.js index b6d1c62d06..e763e34a32 100644 --- a/src/wp-admin/js/customize-controls.js +++ b/src/wp-admin/js/customize-controls.js @@ -3086,13 +3086,14 @@ event.preventDefault(); }); - $('.collapse-sidebar').on( 'click keydown', function( event ) { - if ( api.utils.isKeydownButNotEnterEvent( event ) ) { - return; + $( '.collapse-sidebar' ).on( 'click', function() { + if ( 'true' === $( this ).attr( 'aria-expanded' ) ) { + $( 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' ); - event.preventDefault(); }); $( '.customize-controls-preview-toggle' ).on( 'click keydown', function( event ) { diff --git a/src/wp-admin/js/theme.js b/src/wp-admin/js/theme.js index c307636a37..0e83f4e04b 100644 --- a/src/wp-admin/js/theme.js +++ b/src/wp-admin/js/theme.js @@ -793,7 +793,13 @@ themes.view.Preview = themes.view.Details.extend({ 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' ); return false; diff --git a/src/wp-admin/theme-install.php b/src/wp-admin/theme-install.php index a69eb07b21..92fd53ccb1 100644 --- a/src/wp-admin/theme-install.php +++ b/src/wp-admin/theme-install.php @@ -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’s configuration. If you continue to have problems, please try the support forums.' ), 'themesFound' => __( 'Number of Themes found: %d' ), 'noThemesFound' => __( 'No themes found. Try a different search.' ), + 'collapseSidebar' => __( 'Collapse Sidebar' ), + 'expandSidebar' => __( 'Expand Sidebar' ), ), 'installedThemes' => array_keys( $installed_themes ), ) ); @@ -252,10 +254,10 @@ if ( $tab ) {
diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php index 3e55a11c4f..0d219d69e2 100644 --- a/src/wp-includes/script-loader.php +++ b/src/wp-includes/script-loader.php @@ -419,9 +419,10 @@ function wp_default_scripts( &$scripts ) { 'cheatin' => __( 'Cheatin’ uh?' ), 'previewIframeTitle' => __( 'Site Preview' ), 'loginIframeTitle' => __( 'Session expired' ), - + 'collapseSidebar' => __( 'Collapse Sidebar' ), + 'expandSidebar' => __( 'Expand Sidebar' ), // 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 );