Skip to content

Commit a626ef6

Browse files
committed
Customize: Fix positioning of device-previewed window when publish settings are open.
* Update date control padding. * Collapse publish settings section when opening panes for available widgets or nav menus. * Remove save and cog buttons in mobile preview only mode. * Move definition of `wp.customize.previewedDevice` to `wp.customize.state('previewedDevice')` for centralization, maintaining old alias. * Remove unused CSS because the section is inside form now. Props sayedwp, westonruter. See #39896. Fixes #42027, #42199. git-svn-id: https://develop.svn.wordpress.org/trunk@41860 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 99cff48 commit a626ef6

4 files changed

Lines changed: 37 additions & 12 deletions

File tree

src/wp-admin/css/customize-controls.css

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,20 @@ body:not(.ready) #customize-save-button-wrapper .save {
127127
margin: 0;
128128
}
129129

130-
.outer-section-open .wp-full-overlay.expanded #customize-preview {
130+
.outer-section-open .wp-full-overlay.expanded .wp-full-overlay-main {
131131
left: 300px;
132132
opacity: 0.4;
133133
}
134134

135+
.outer-section-open .wp-full-overlay.expanded.preview-tablet .wp-full-overlay-main,
136+
.outer-section-open .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main,
137+
.adding-menu-items .wp-full-overlay.expanded.preview-tablet .wp-full-overlay-main,
138+
.adding-menu-items .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main,
139+
.adding-widget .wp-full-overlay.expanded.preview-tablet .wp-full-overlay-main,
140+
.adding-widget .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main {
141+
left: 64%;
142+
}
143+
135144
#customize-outer-theme-controls li.notice {
136145
padding-top: 8px;
137146
padding-bottom: 8px;
@@ -379,7 +388,7 @@ body.trashing #publish-settings {
379388
box-sizing: content-box;
380389
width: 100%;
381390
margin-left: -12px;
382-
padding: 12px 12px 10px;
391+
padding: 12px;
383392
background: #ffffff;
384393
border-bottom: 1px solid #ddd;
385394
margin-bottom: 0;
@@ -506,8 +515,7 @@ body.trashing #publish-settings {
506515
margin-bottom: 0;
507516
}
508517

509-
#customize-controls .customize-info .customize-section-description,
510-
#customize-outer-theme-controls .customize-section-description {
518+
#customize-controls .customize-info .customize-section-description {
511519
margin-bottom: 15px;
512520
}
513521

@@ -562,9 +570,6 @@ body.trashing #publish-settings {
562570
#customize-controls .control-section:hover > .accordion-section-title,
563571
#customize-controls .control-section .accordion-section-title:hover,
564572
#customize-controls .control-section.open .accordion-section-title,
565-
#customize-outer-theme-controls .control-section .accordion-section-title:hover,
566-
#customize-outer-theme-controls .control-section.open .accordion-section-title,
567-
#customize-outer-theme-controls .control-section .accordion-section-title:focus,
568573
#customize-controls .control-section .accordion-section-title:focus {
569574
color: #0073aa;
570575
background: #f3f3f5;
@@ -1724,8 +1729,7 @@ p.customize-section-description {
17241729
.control-panel-themes .accordion-section-title span.customize-action,
17251730
#customize-controls .customize-section-title span.customize-action,
17261731
#customize-controls .control-section-themes .accordion-section-title span.customize-action,
1727-
#customize-controls .customize-section-title span.customize-action,
1728-
#customize-outer-theme-controls .customize-section-title span.customize-action {
1732+
#customize-controls .customize-section-title span.customize-action {
17291733
font-size: 13px;
17301734
display: block;
17311735
font-weight: 400;
@@ -2791,6 +2795,14 @@ body.adding-widget .add-new-widget:before,
27912795
}
27922796
}
27932797

2798+
@media screen and ( max-width: 1200px ) {
2799+
.outer-section-open .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main,
2800+
.adding-menu-items .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main,
2801+
.adding-widget .wp-full-overlay.expanded.preview-mobile .wp-full-overlay-main {
2802+
left: 67%;
2803+
}
2804+
}
2805+
27942806
@media screen and ( max-width: 640px ) {
27952807
#customize-controls {
27962808
width: 100%;
@@ -2837,6 +2849,10 @@ body.adding-widget .add-new-widget:before,
28372849
display: none;
28382850
}
28392851

2852+
.preview-only #customize-save-button-wrapper {
2853+
margin-top: -46px;
2854+
}
2855+
28402856
.customize-controls-preview-toggle .preview:before,
28412857
.customize-controls-preview-toggle .controls:before {
28422858
font: normal 20px/1 dashicons;

src/wp-admin/js/customize-controls.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6788,7 +6788,8 @@
67886788
'remainingTimeToPublish',
67896789
'previewerAlive',
67906790
'editShortcutVisibility',
6791-
'changesetLocked'
6791+
'changesetLocked',
6792+
'previewedDevice'
67926793
], function( name ) {
67936794
api.state.create( name );
67946795
});
@@ -8317,8 +8318,8 @@
83178318
};
83188319
}());
83198320

8320-
// Previewed device bindings.
8321-
api.previewedDevice = new api.Value();
8321+
// Previewed device bindings. (The api.previewedDevice property is how this Value was first introduced, but since it has moved to api.state.)
8322+
api.previewedDevice = api.state( 'previewedDevice' );
83228323

83238324
// Set the default device.
83248325
api.bind( 'ready', function() {

src/wp-admin/js/customize-nav-menus.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,10 @@
682682

683683
this.itemSectionHeight();
684684

685+
if ( api.section.has( 'publish_settings' ) ) {
686+
api.section( 'publish_settings' ).collapse();
687+
}
688+
685689
$( 'body' ).addClass( 'adding-menu-items' );
686690

687691
close = function() {

src/wp-admin/js/customize-widgets.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,10 @@
330330
}
331331
} );
332332

333+
if ( api.section.has( 'publish_settings' ) ) {
334+
api.section( 'publish_settings' ).collapse();
335+
}
336+
333337
$( 'body' ).addClass( 'adding-widget' );
334338

335339
this.$el.find( '.selected' ).removeClass( 'selected' );

0 commit comments

Comments
 (0)