From b1946768769b8f6d2c6ca72f6d64d8021e0823e9 Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Wed, 1 Apr 2015 12:35:26 +0000 Subject: [PATCH] Customizer Theme Switcher: Switch the details/live preview buttons. props celloexpressions, ocean90. fixes #31791. git-svn-id: https://develop.svn.wordpress.org/trunk@31954 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/css/customize-controls.css | 23 ++++++++++++++---- src/wp-admin/includes/theme.php | 8 +++---- src/wp-admin/js/customize-controls.js | 24 ++++++++++--------- .../class-wp-customize-control.php | 9 +++---- 4 files changed, 41 insertions(+), 23 deletions(-) diff --git a/src/wp-admin/css/customize-controls.css b/src/wp-admin/css/customize-controls.css index 030e02edcc..3e35b7eaa9 100644 --- a/src/wp-admin/css/customize-controls.css +++ b/src/wp-admin/css/customize-controls.css @@ -906,10 +906,6 @@ p.customize-section-description { font-size: 32px; } -.wp-customizer .theme-browser .theme.active .theme-name { - padding-right: 15px; -} - .wp-customizer #themes-filter { font-size: 16px; font-weight: 300; @@ -917,6 +913,25 @@ p.customize-section-description { width: 100%; } + +.wp-customizer .theme-browser .theme.active:hover, +.wp-customizer .theme-browser .theme.active:focus { + cursor: default; +} + +.wp-customizer .theme-browser .theme.active .more-details { + display: none; +} + +.wp-customizer .theme-browser .theme.active .theme-name { + padding-right: 15px; +} + +.wp-customizer .theme-browser.rendered .theme.active:hover .theme-screenshot img, +.wp-customizer .theme-browser.rendered .theme.active:focus .theme-screenshot img { + opacity: 1; +} + /* Panel-like behavior */ #accordion-section-themes .accordion-section-title:after { content: "\f148"; diff --git a/src/wp-admin/includes/theme.php b/src/wp-admin/includes/theme.php index 0d5c0beea1..4024b395f4 100644 --- a/src/wp-admin/includes/theme.php +++ b/src/wp-admin/includes/theme.php @@ -547,13 +547,13 @@ function customize_themes_print_templates() { -
- <# if ( ! data.active ) { #> + <# if ( ! data.active ) { #> +
- <# } #> -
+
+ <# } #> -
+ $preview_url = site_url( add_query_arg( 'theme', '{{ data.theme.id }}' ) ); + ?> +
tabindex="0"<# } #> data-preview-url="" aria-describedby="{{ data.theme.id }}-action {{ data.theme.id }}-name"> <# if ( data.theme.screenshot[0] ) { #>
@@ -1209,7 +1210,7 @@ class WP_Customize_Theme_Control extends WP_Customize_Control { <# } else { #>
<# } #> - +
<# if ( data.theme.active ) { #> @@ -1225,7 +1226,7 @@ class WP_Customize_Theme_Control extends WP_Customize_Control { <# if ( ! data.theme.active ) { #>
- +
<# } #>