diff --git src/wp-includes/css/customize-preview.css src/wp-includes/css/customize-preview.css
index c245d25..daa41be 100644
|
|
|
35 | 35 | border: 1px solid #0085ba; |
36 | 36 | } |
37 | 37 | |
38 | | /* Styles for the actual shortcut */ |
| 38 | /** |
| 39 | * Styles for the actual shortcut |
| 40 | * |
| 41 | * Note that some properties are overly verbose to prevent theme interference. |
| 42 | */ |
39 | 43 | .widget .customize-partial-edit-shortcut button, |
40 | 44 | .customize-partial-edit-shortcut button { |
41 | 45 | position: absolute; |
42 | | left: -36px; |
| 46 | left: -30px; |
| 47 | top: 2px; |
43 | 48 | color: #fff; |
44 | 49 | width: 30px; |
45 | 50 | height: 30px; |
… |
… |
body.customize-partial-edit-shortcuts-hidden .customize-partial-edit-shortcut bu |
101 | 106 | visibility: hidden; |
102 | 107 | } |
103 | 108 | |
104 | | .customize-partial-edit-shortcut-left-margin.customize-partial-edit-shortcut button { |
105 | | left: 0; |
106 | | } |
107 | | |
108 | 109 | @-webkit-keyframes customize-partial-edit-shortcut-bounce-appear { |
109 | 110 | from, 20%, 40%, 60%, 80%, to { |
110 | 111 | -webkit-animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); |
… |
… |
body.customize-partial-edit-shortcuts-hidden .customize-partial-edit-shortcut bu |
242 | 243 | } |
243 | 244 | |
244 | 245 | @media screen and (max-width:800px) { |
| 246 | .widget .customize-partial-edit-shortcut button, |
| 247 | .customize-partial-edit-shortcut button { |
| 248 | left: -32px; |
| 249 | } |
| 250 | } |
| 251 | |
| 252 | @media screen and (max-width:320px) { |
| 253 | .site-title { padding-left: 10px; } |
| 254 | |
| 255 | .widget-area .widget { |
| 256 | padding-left: 10px; |
| 257 | } |
| 258 | |
| 259 | .widget .customize-partial-edit-shortcut button, |
245 | 260 | .customize-partial-edit-shortcut button { |
246 | | left: -18px; /* Assume there will be less of a margin available on smaller screens */ |
| 261 | left: -30px; |
247 | 262 | } |
248 | 263 | } |
diff --git src/wp-includes/js/customize-selective-refresh.js src/wp-includes/js/customize-selective-refresh.js
index 70e2b96..e97b1cf 100644
|
|
wp.customize.selectiveRefresh = ( function( $, api ) { |
118 | 118 | return; |
119 | 119 | } |
120 | 120 | $shortcut = partial.createEditShortcut(); |
121 | | partial.positionEditShortcut( placement, $shortcut ); |
| 121 | partial.addEditShortcutToPlacement( placement, $shortcut ); |
122 | 122 | $shortcut.on( 'click', function( event ) { |
123 | 123 | event.preventDefault(); |
124 | 124 | event.stopPropagation(); |
… |
… |
wp.customize.selectiveRefresh = ( function( $, api ) { |
127 | 127 | }, |
128 | 128 | |
129 | 129 | /** |
130 | | * Position an edit shortcut for the placement container. |
131 | | * |
132 | | * The shortcut must already be created and added to the page. |
| 130 | * Add an edit shortcut to the placement container. |
133 | 131 | * |
134 | 132 | * @since 4.7 |
135 | 133 | * |
… |
… |
wp.customize.selectiveRefresh = ( function( $, api ) { |
137 | 135 | * @param {jQuery} $editShortcut The shortcut element as a jQuery object. |
138 | 136 | * @returns {void} |
139 | 137 | */ |
140 | | positionEditShortcut: function( placement, $editShortcut ) { |
141 | | var $placementContainer = $( placement.container ), $editButton; |
| 138 | addEditShortcutToPlacement: function( placement, $editShortcut ) { |
| 139 | var $placementContainer = $( placement.container ); |
142 | 140 | $placementContainer.prepend( $editShortcut ); |
143 | 141 | if ( ! $placementContainer.is( ':visible' ) || 'none' === $placementContainer.css( 'display' ) ) { |
144 | 142 | $editShortcut.addClass( 'customize-partial-edit-shortcut-hidden' ); |
145 | 143 | } |
146 | | $editButton = $editShortcut.find( 'button' ); |
147 | | $editShortcut.toggleClass( 'customize-partial-edit-shortcut-left-margin', $editButton.offset().left < 2 ); |
148 | 144 | }, |
149 | 145 | |
150 | 146 | /** |