Changeset 39202
- Timestamp:
- 11/11/2016 09:46:47 AM (8 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/css/customize-preview.css
r39186 r39202 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; … … 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 { … … 243 244 244 245 @media screen and (max-width:800px) { 246 .widget .customize-partial-edit-shortcut button, 245 247 .customize-partial-edit-shortcut button { 246 left: -18px; /* Assume there will be less of a margin available on smaller screens */ 247 } 248 } 248 left: -32px; 249 } 250 } 251 252 @media screen and (max-width:320px) { 253 .site-title { 254 padding-left: 10px; 255 } 256 257 .widget-area .widget { 258 padding-left: 10px; 259 } 260 261 .widget .customize-partial-edit-shortcut button, 262 .customize-partial-edit-shortcut button { 263 left: -30px; 264 } 265 } -
trunk/src/wp-includes/js/customize-selective-refresh.js
r39144 r39202 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(); … … 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 … … 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
Note: See TracChangeset
for help on using the changeset viewer.