Changeset 38853
- Timestamp:
- 10/21/2016 06:36:57 AM (8 years ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/css/customize-controls.css
r38829 r38853 56 56 #customize-controls .customize-info.section-meta { 57 57 margin-bottom: 15px; 58 } 59 60 #customize-controls .customize-info.is-in-view, 61 #customize-controls .customize-section-title.is-in-view { 62 position: absolute; 63 z-index: 9; 64 width: 100%; 65 -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, .1); 66 box-shadow: 0 1px 0 rgba(0, 0, 0, .1); 67 } 68 69 #customize-controls .customize-section-title.is-in-view { 70 margin-top: 0; 71 } 72 73 #customize-controls .customize-info.is-in-view + .accordion-section { 74 margin-top: 15px; 75 } 76 77 #customize-controls .customize-info.is-sticky, 78 #customize-controls .customize-section-title.is-sticky { 79 position: fixed; 80 top: 46px; 58 81 } 59 82 … … 324 347 #customize-theme-controls .customize-pane-child.accordion-section-content { 325 348 padding: 12px; 349 } 350 351 #customize-theme-controls .customize-pane-child.menu li { 352 position: static; 326 353 } 327 354 … … 410 437 float: left; 411 438 width: 48px; 412 height: 7 0px;439 height: 71px; 413 440 padding: 0 24px 0 0; 414 441 margin: 0; … … 424 451 425 452 .customize-section-back { 426 height: 7 3px;453 height: 74px; 427 454 } 428 455 … … 485 512 486 513 .wp-full-overlay-sidebar .wp-full-overlay-header { 514 background-color: #eee; 487 515 -webkit-transition: padding ease-in-out .18s; 488 516 transition: padding ease-in-out .18s; … … 1089 1117 top: 0; 1090 1118 left: 0; 1119 -webkit-transition: .18s left ease-in-out; 1091 1120 transition: .18s left ease-in-out; 1092 1121 margin: 0 0 0 300px; 1093 1122 padding:25px; 1094 1123 overflow-y: scroll; 1124 width: -webkit-calc(100% - 350px); 1095 1125 width: calc(100% - 350px); 1126 height: -webkit-calc(100% - 50px); 1096 1127 height: calc(100% - 50px); 1097 1128 background: #eee; … … 1105 1136 position: relative; 1106 1137 top: 0; 1138 -webkit-transition: .18s top ease-in-out; 1107 1139 transition: .18s top ease-in-out; 1108 1140 } … … 1111 1143 #customize-footer-actions .collapse-sidebar { 1112 1144 bottom: 0; 1145 -webkit-transition: .18s bottom ease-in-out; 1113 1146 transition: .18s bottom ease-in-out; 1114 1147 } … … 1147 1180 1148 1181 /* Adds a delay before fading in to avoid it "jumping" */ 1182 @-webkit-keyframes themes-fade-in { 1183 0% { 1184 opacity: 0; 1185 } 1186 50% { 1187 opacity: 0; 1188 } 1189 100% { 1190 opacity: 1; 1191 } 1192 } 1149 1193 @keyframes themes-fade-in { 1150 1194 0% { … … 1160 1204 1161 1205 .control-panel-themes .customize-themes-full-container.animate { 1206 -webkit-animation: .6s themes-fade-in 1; 1162 1207 animation: .6s themes-fade-in 1; 1163 1208 } 1164 1209 1165 1210 .in-themes-panel:not(.animating) .control-panel-themes .filter-themes-count { 1211 -webkit-animation: .6s themes-fade-in 1; 1166 1212 animation: .6s themes-fade-in 1; 1167 1213 } … … 1206 1252 1207 1253 .control-panel-themes .filter-themes-count { 1254 width: -webkit-calc(100% - 93px); 1208 1255 width: calc(100% - 93px); 1209 1256 } … … 1237 1284 1238 1285 .control-panel-themes .customize-themes-full-container { 1286 width: -webkit-calc(100% - 50px); 1239 1287 width: calc(100% - 50px); 1240 1288 margin: 0; 1241 1289 top: 46px; 1290 height: -webkit-calc(100% - 96px); 1242 1291 height: calc(100% - 96px); 1243 1292 z-index: 1; … … 1274 1323 width: 100%; 1275 1324 background: #fff; 1325 -webkit-box-shadow: none; 1276 1326 box-shadow: none; 1277 1327 outline: none; … … 1305 1355 content: "\f147"; 1306 1356 font: 16px/1 dashicons; 1357 -webkit-box-sizing: border-box; 1358 -moz-box-sizing: border-box; 1307 1359 box-sizing: border-box; 1308 1360 width: 20px; 1309 1361 height: 20px; 1310 1362 padding: 3px 3px 1px 1px; /* Re-align the icon to the smaller grid */ 1363 -webkit-border-radius: 100%; 1311 1364 border-radius: 100%; 1312 1365 position: absolute; … … 1377 1430 border: none; 1378 1431 padding: 0; 1432 -webkit-box-shadow: none; 1379 1433 box-shadow: none; 1380 1434 } … … 1407 1461 border-bottom-color: #0073aa; /* Color change for focus style should be acceptable because border-bottom is barely visible previously. */ 1408 1462 outline: none; 1463 -webkit-box-shadow: none; 1409 1464 box-shadow: none; 1410 1465 } … … 1426 1481 margin: 0; 1427 1482 padding: 12px 10px 12px 34px; 1483 width: -webkit-calc(100% - 46px); 1428 1484 width: calc(100% - 46px); 1429 1485 line-height: 16px; … … 1454 1510 width: 20px; 1455 1511 height: 20px; 1512 left: -webkit-calc(50% - 10px); 1456 1513 left: calc(50% - 10px); 1457 1514 float: none; … … 1489 1546 1490 1547 .customize-control.customize-control-theme { /* override most properties on .customize-control */ 1548 -webkit-box-sizing: border-box; 1549 -moz-box-sizing: border-box; 1491 1550 box-sizing: border-box; 1492 1551 width: 18.4%; -
trunk/src/wp-admin/css/customize-nav-menus.css
r38709 r38853 66 66 } 67 67 68 .wp-customizer .menu-item-handle:hover { 69 z-index: 8; 70 } 71 68 72 .customize-control-nav_menu_item.has-notifications .menu-item-handle { 69 73 border-left: 4px solid #00a0d2; … … 73 77 max-width: 100%; 74 78 overflow: hidden; 79 z-index: 8; 75 80 padding: 10px; 76 81 background: #eee; -
trunk/src/wp-admin/js/customize-controls.js
r38829 r38853 1005 1005 content.addClass( 'open' ); 1006 1006 overlay.addClass( 'section-open' ); 1007 api.state( 'expandedSection' ).set( section ); 1007 1008 }, this ); 1008 1009 } … … 1043 1044 content.removeClass( 'open' ); 1044 1045 overlay.removeClass( 'section-open' ); 1046 if ( section === api.state( 'expandedSection' ).get() ) { 1047 api.state( 'expandedSection' ).set( false ); 1048 } 1045 1049 1046 1050 } else { … … 1996 2000 overlay.addClass( 'in-sub-panel' ); 1997 2001 accordionSection.addClass( 'current-panel' ); 2002 api.state( 'expandedPanel' ).set( panel ); 1998 2003 1999 2004 } else if ( ! expanded && accordionSection.hasClass( 'current-panel' ) ) { … … 2012 2017 overlay.removeClass( 'in-sub-panel' ); 2013 2018 accordionSection.removeClass( 'current-panel' ); 2019 if ( panel === api.state( 'expandedPanel' ).get() ) { 2020 api.state( 'expandedPanel' ).set( false ); 2021 } 2014 2022 } 2015 2023 }, … … 4969 4977 processing = state.create( 'processing' ), 4970 4978 paneVisible = state.create( 'paneVisible' ), 4979 expandedPanel = state.create( 'expandedPanel' ), 4980 expandedSection = state.create( 'expandedSection' ), 4971 4981 changesetStatus = state.create( 'changesetStatus' ), 4972 4982 previewerAlive = state.create( 'previewerAlive' ), … … 5004 5014 processing( 0 ); 5005 5015 paneVisible( true ); 5016 expandedPanel( false ); 5017 expandedSection( false ); 5006 5018 previewerAlive( true ); 5007 5019 changesetStatus( api.settings.changeset.status ); … … 5157 5169 }); 5158 5170 5171 /* 5172 * Sticky header feature. 5173 */ 5174 (function initStickyHeaders() { 5175 var parentContainer = $( '.wp-full-overlay-sidebar-content' ), 5176 changeContainer, getHeaderHeight, releaseStickyHeader, resetStickyHeader, positionStickyHeader, 5177 activeHeader, lastScrollTop; 5178 5179 // Determine which panel or section is currently expanded. 5180 changeContainer = function( container ) { 5181 var newInstance = container, 5182 expandedSection = api.state( 'expandedSection' ).get(), 5183 expandedPanel = api.state( 'expandedPanel' ).get(), 5184 headerElement; 5185 5186 // Release previously active header element. 5187 if ( activeHeader && activeHeader.element ) { 5188 releaseStickyHeader( activeHeader.element ); 5189 } 5190 5191 if ( ! newInstance ) { 5192 if ( ! expandedSection && expandedPanel && expandedPanel.contentContainer ) { 5193 newInstance = expandedPanel; 5194 } else if ( ! expandedPanel && expandedSection && expandedSection.contentContainer ) { 5195 newInstance = expandedSection; 5196 } else { 5197 activeHeader = false; 5198 return; 5199 } 5200 } 5201 5202 headerElement = newInstance.contentContainer.find( '.customize-section-title, .panel-meta' ).first(); 5203 if ( headerElement.length ) { 5204 activeHeader = { 5205 instance: newInstance, 5206 element: headerElement, 5207 parent: headerElement.closest( '.customize-pane-child' ), 5208 height: getHeaderHeight( headerElement ) 5209 }; 5210 if ( expandedSection ) { 5211 resetStickyHeader( activeHeader.element, activeHeader.parent ); 5212 } 5213 } else { 5214 activeHeader = false; 5215 } 5216 }; 5217 api.state( 'expandedSection' ).bind( changeContainer ); 5218 api.state( 'expandedPanel' ).bind( changeContainer ); 5219 5220 // Throttled scroll event handler. 5221 parentContainer.on( 'scroll', _.throttle( function() { 5222 if ( ! activeHeader ) { 5223 return; 5224 } 5225 5226 var scrollTop = parentContainer.scrollTop(), 5227 isScrollingUp = ( lastScrollTop ) ? scrollTop <= lastScrollTop : true; 5228 5229 lastScrollTop = scrollTop; 5230 positionStickyHeader( activeHeader, scrollTop, isScrollingUp ); 5231 }, 8 ) ); 5232 5233 // Release header element if it is sticky. 5234 releaseStickyHeader = function( headerElement ) { 5235 if ( ! headerElement.hasClass( 'is-sticky' ) ) { 5236 return; 5237 } 5238 headerElement 5239 .removeClass( 'is-sticky' ) 5240 .addClass( 'maybe-sticky is-in-view' ) 5241 .css( 'top', parentContainer.scrollTop() + 'px' ); 5242 }; 5243 5244 // Reset position of the sticky header. 5245 resetStickyHeader = function( headerElement, headerParent ) { 5246 headerElement 5247 .removeClass( 'maybe-sticky is-in-view' ) 5248 .css( { 5249 width: '', 5250 top: '' 5251 } ); 5252 headerParent.css( 'padding-top', '' ); 5253 }; 5254 5255 // Get header height. 5256 getHeaderHeight = function( headerElement ) { 5257 var height = headerElement.data( 'height' ); 5258 if ( ! height ) { 5259 height = headerElement.outerHeight(); 5260 headerElement.data( 'height', height ); 5261 } 5262 return height; 5263 }; 5264 5265 // Reposition header on throttled `scroll` event. 5266 positionStickyHeader = function( header, scrollTop, isScrollingUp ) { 5267 var headerElement = header.element, 5268 headerParent = header.parent, 5269 headerHeight = header.height, 5270 headerTop = parseInt( headerElement.css( 'top' ), 10 ), 5271 maybeSticky = headerElement.hasClass( 'maybe-sticky' ), 5272 isSticky = headerElement.hasClass( 'is-sticky' ), 5273 isInView = headerElement.hasClass( 'is-in-view' ); 5274 5275 // When scrolling down, gradually hide sticky header. 5276 if ( ! isScrollingUp ) { 5277 if ( isSticky ) { 5278 headerTop = scrollTop; 5279 headerElement 5280 .removeClass( 'is-sticky' ) 5281 .css( { 5282 top: headerTop + 'px', 5283 width: '' 5284 } ); 5285 } 5286 if ( isInView && scrollTop > headerTop + headerHeight ) { 5287 headerElement.removeClass( 'is-in-view' ); 5288 headerParent.css( 'padding-top', '' ); 5289 } 5290 return; 5291 } 5292 5293 // Scrolling up. 5294 if ( ! maybeSticky && scrollTop >= headerHeight ) { 5295 maybeSticky = true; 5296 headerElement.addClass( 'maybe-sticky' ); 5297 } else if ( 0 === scrollTop ) { 5298 // Reset header in base position. 5299 headerElement 5300 .removeClass( 'maybe-sticky is-in-view is-sticky' ) 5301 .css( { 5302 top: '', 5303 width: '' 5304 } ); 5305 headerParent.css( 'padding-top', '' ); 5306 return; 5307 } 5308 5309 if ( isInView && ! isSticky ) { 5310 // Header is in the view but is not yet sticky. 5311 if ( headerTop >= scrollTop ) { 5312 // Header is fully visible. 5313 headerElement 5314 .addClass( 'is-sticky' ) 5315 .css( { 5316 top: '', 5317 width: headerParent.outerWidth() + 'px' 5318 } ); 5319 } 5320 } else if ( maybeSticky && ! isInView ) { 5321 // Header is out of the view. 5322 headerElement 5323 .addClass( 'is-in-view' ) 5324 .css( 'top', ( scrollTop - headerHeight ) + 'px' ); 5325 headerParent.css( 'padding-top', headerHeight + 'px' ); 5326 } 5327 }; 5328 }()); 5329 5159 5330 // Previewed device bindings. 5160 5331 api.previewedDevice = new api.Value();
Note: See TracChangeset
for help on using the changeset viewer.