<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[38853] trunk/src/wp-admin: Customize: Add sticky headers for panels and sections.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/38853">38853</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/38853","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>westonruter</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2016-10-21 06:36:57 +0000 (Fri, 21 Oct 2016)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Customize: Add sticky headers for panels and sections.
Includes autoprefixing of CSS.
Props delawski, celloexpressions.
See <a href="https://core.trac.wordpress.org/ticket/35186">#35186</a>.
Fixes <a href="https://core.trac.wordpress.org/ticket/34343">#34343</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadmincsscustomizecontrolscss">trunk/src/wp-admin/css/customize-controls.css</a></li>
<li><a href="#trunksrcwpadmincsscustomizenavmenuscss">trunk/src/wp-admin/css/customize-nav-menus.css</a></li>
<li><a href="#trunksrcwpadminjscustomizecontrolsjs">trunk/src/wp-admin/js/customize-controls.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadmincsscustomizecontrolscss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/css/customize-controls.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/css/customize-controls.css 2016-10-21 05:59:34 UTC (rev 38852)
+++ trunk/src/wp-admin/css/customize-controls.css 2016-10-21 06:36:57 UTC (rev 38853)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -57,6 +57,29 @@
</span><span class="cx" style="display: block; padding: 0 10px"> margin-bottom: 15px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+#customize-controls .customize-info.is-in-view,
+#customize-controls .customize-section-title.is-in-view {
+ position: absolute;
+ z-index: 9;
+ width: 100%;
+ -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, .1);
+ box-shadow: 0 1px 0 rgba(0, 0, 0, .1);
+}
+
+#customize-controls .customize-section-title.is-in-view {
+ margin-top: 0;
+}
+
+#customize-controls .customize-info.is-in-view + .accordion-section {
+ margin-top: 15px;
+}
+
+#customize-controls .customize-info.is-sticky,
+#customize-controls .customize-section-title.is-sticky {
+ position: fixed;
+ top: 46px;
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> #customize-controls .customize-info .accordion-section-title {
</span><span class="cx" style="display: block; padding: 0 10px"> background: #fff;
</span><span class="cx" style="display: block; padding: 0 10px"> color: #555;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -325,6 +348,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> padding: 12px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+#customize-theme-controls .customize-pane-child.menu li {
+ position: static;
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> .customize-section-description-container {
</span><span class="cx" style="display: block; padding: 0 10px"> margin-bottom: 15px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -409,7 +436,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> display: block;
</span><span class="cx" style="display: block; padding: 0 10px"> float: left;
</span><span class="cx" style="display: block; padding: 0 10px"> width: 48px;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- height: 70px;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ height: 71px;
</ins><span class="cx" style="display: block; padding: 0 10px"> padding: 0 24px 0 0;
</span><span class="cx" style="display: block; padding: 0 10px"> margin: 0;
</span><span class="cx" style="display: block; padding: 0 10px"> background: #fff;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -423,7 +450,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-section-back {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- height: 73px;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ height: 74px;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .ios .customize-panel-back {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -484,6 +511,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .wp-full-overlay-sidebar .wp-full-overlay-header {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ background-color: #eee;
</ins><span class="cx" style="display: block; padding: 0 10px"> -webkit-transition: padding ease-in-out .18s;
</span><span class="cx" style="display: block; padding: 0 10px"> transition: padding ease-in-out .18s;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1088,11 +1116,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> position: fixed;
</span><span class="cx" style="display: block; padding: 0 10px"> top: 0;
</span><span class="cx" style="display: block; padding: 0 10px"> left: 0;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ -webkit-transition: .18s left ease-in-out;
</ins><span class="cx" style="display: block; padding: 0 10px"> transition: .18s left ease-in-out;
</span><span class="cx" style="display: block; padding: 0 10px"> margin: 0 0 0 300px;
</span><span class="cx" style="display: block; padding: 0 10px"> padding:25px;
</span><span class="cx" style="display: block; padding: 0 10px"> overflow-y: scroll;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ width: -webkit-calc(100% - 350px);
</ins><span class="cx" style="display: block; padding: 0 10px"> width: calc(100% - 350px);
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ height: -webkit-calc(100% - 50px);
</ins><span class="cx" style="display: block; padding: 0 10px"> height: calc(100% - 50px);
</span><span class="cx" style="display: block; padding: 0 10px"> background: #eee;
</span><span class="cx" style="display: block; padding: 0 10px"> z-index: 20;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1104,12 +1135,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> #customize-header-actions .customize-controls-preview-toggle {
</span><span class="cx" style="display: block; padding: 0 10px"> position: relative;
</span><span class="cx" style="display: block; padding: 0 10px"> top: 0;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ -webkit-transition: .18s top ease-in-out;
</ins><span class="cx" style="display: block; padding: 0 10px"> transition: .18s top ease-in-out;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> #customize-footer-actions,
</span><span class="cx" style="display: block; padding: 0 10px"> #customize-footer-actions .collapse-sidebar {
</span><span class="cx" style="display: block; padding: 0 10px"> bottom: 0;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ -webkit-transition: .18s bottom ease-in-out;
</ins><span class="cx" style="display: block; padding: 0 10px"> transition: .18s bottom ease-in-out;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1146,6 +1179,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* Adds a delay before fading in to avoid it "jumping" */
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+@-webkit-keyframes themes-fade-in {
+ 0% {
+ opacity: 0;
+ }
+ 50% {
+ opacity: 0;
+ }
+ 100% {
+ opacity: 1;
+ }
+}
</ins><span class="cx" style="display: block; padding: 0 10px"> @keyframes themes-fade-in {
</span><span class="cx" style="display: block; padding: 0 10px"> 0% {
</span><span class="cx" style="display: block; padding: 0 10px"> opacity: 0;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1159,10 +1203,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .control-panel-themes .customize-themes-full-container.animate {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ -webkit-animation: .6s themes-fade-in 1;
</ins><span class="cx" style="display: block; padding: 0 10px"> animation: .6s themes-fade-in 1;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .in-themes-panel:not(.animating) .control-panel-themes .filter-themes-count {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ -webkit-animation: .6s themes-fade-in 1;
</ins><span class="cx" style="display: block; padding: 0 10px"> animation: .6s themes-fade-in 1;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1205,6 +1251,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .control-panel-themes .filter-themes-count {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ width: -webkit-calc(100% - 93px);
</ins><span class="cx" style="display: block; padding: 0 10px"> width: calc(100% - 93px);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1236,9 +1283,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .control-panel-themes .customize-themes-full-container {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ width: -webkit-calc(100% - 50px);
</ins><span class="cx" style="display: block; padding: 0 10px"> width: calc(100% - 50px);
</span><span class="cx" style="display: block; padding: 0 10px"> margin: 0;
</span><span class="cx" style="display: block; padding: 0 10px"> top: 46px;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ height: -webkit-calc(100% - 96px);
</ins><span class="cx" style="display: block; padding: 0 10px"> height: calc(100% - 96px);
</span><span class="cx" style="display: block; padding: 0 10px"> z-index: 1;
</span><span class="cx" style="display: block; padding: 0 10px"> display: none;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1273,6 +1322,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .control-panel-themes .customize-themes-section-title {
</span><span class="cx" style="display: block; padding: 0 10px"> width: 100%;
</span><span class="cx" style="display: block; padding: 0 10px"> background: #fff;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ -webkit-box-shadow: none;
</ins><span class="cx" style="display: block; padding: 0 10px"> box-shadow: none;
</span><span class="cx" style="display: block; padding: 0 10px"> outline: none;
</span><span class="cx" style="display: block; padding: 0 10px"> border-top: none;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1304,10 +1354,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .control-panel-themes .theme-section .customize-themes-section-title.selected:after {
</span><span class="cx" style="display: block; padding: 0 10px"> content: "\f147";
</span><span class="cx" style="display: block; padding: 0 10px"> font: 16px/1 dashicons;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
</ins><span class="cx" style="display: block; padding: 0 10px"> box-sizing: border-box;
</span><span class="cx" style="display: block; padding: 0 10px"> width: 20px;
</span><span class="cx" style="display: block; padding: 0 10px"> height: 20px;
</span><span class="cx" style="display: block; padding: 0 10px"> padding: 3px 3px 1px 1px; /* Re-align the icon to the smaller grid */
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ -webkit-border-radius: 100%;
</ins><span class="cx" style="display: block; padding: 0 10px"> border-radius: 100%;
</span><span class="cx" style="display: block; padding: 0 10px"> position: absolute;
</span><span class="cx" style="display: block; padding: 0 10px"> top: 9px;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1376,6 +1429,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> background: transparent;
</span><span class="cx" style="display: block; padding: 0 10px"> border: none;
</span><span class="cx" style="display: block; padding: 0 10px"> padding: 0;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ -webkit-box-shadow: none;
</ins><span class="cx" style="display: block; padding: 0 10px"> box-shadow: none;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1406,6 +1460,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> color: #0073aa;
</span><span class="cx" style="display: block; padding: 0 10px"> border-bottom-color: #0073aa; /* Color change for focus style should be acceptable because border-bottom is barely visible previously. */
</span><span class="cx" style="display: block; padding: 0 10px"> outline: none;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ -webkit-box-shadow: none;
</ins><span class="cx" style="display: block; padding: 0 10px"> box-shadow: none;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1425,6 +1480,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> color: #555d66;
</span><span class="cx" style="display: block; padding: 0 10px"> margin: 0;
</span><span class="cx" style="display: block; padding: 0 10px"> padding: 12px 10px 12px 34px;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ width: -webkit-calc(100% - 46px);
</ins><span class="cx" style="display: block; padding: 0 10px"> width: calc(100% - 46px);
</span><span class="cx" style="display: block; padding: 0 10px"> line-height: 16px;
</span><span class="cx" style="display: block; padding: 0 10px"> font-weight: 600;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1453,6 +1509,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> clear: both;
</span><span class="cx" style="display: block; padding: 0 10px"> width: 20px;
</span><span class="cx" style="display: block; padding: 0 10px"> height: 20px;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ left: -webkit-calc(50% - 10px);
</ins><span class="cx" style="display: block; padding: 0 10px"> left: calc(50% - 10px);
</span><span class="cx" style="display: block; padding: 0 10px"> float: none;
</span><span class="cx" style="display: block; padding: 0 10px"> margin-top: 50px;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1488,6 +1545,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .customize-control.customize-control-theme { /* override most properties on .customize-control */
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
</ins><span class="cx" style="display: block; padding: 0 10px"> box-sizing: border-box;
</span><span class="cx" style="display: block; padding: 0 10px"> width: 18.4%;
</span><span class="cx" style="display: block; padding: 0 10px"> margin: 0 2% 2% 0;
</span></span></pre></div>
<a id="trunksrcwpadmincsscustomizenavmenuscss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/css/customize-nav-menus.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/css/customize-nav-menus.css 2016-10-21 05:59:34 UTC (rev 38852)
+++ trunk/src/wp-admin/css/customize-nav-menus.css 2016-10-21 06:36:57 UTC (rev 38853)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -65,6 +65,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> text-align: right;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.wp-customizer .menu-item-handle:hover {
+ z-index: 8;
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> .customize-control-nav_menu_item.has-notifications .menu-item-handle {
</span><span class="cx" style="display: block; padding: 0 10px"> border-left: 4px solid #00a0d2;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,6 +76,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .wp-customizer .menu-item-settings {
</span><span class="cx" style="display: block; padding: 0 10px"> max-width: 100%;
</span><span class="cx" style="display: block; padding: 0 10px"> overflow: hidden;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ z-index: 8;
</ins><span class="cx" style="display: block; padding: 0 10px"> padding: 10px;
</span><span class="cx" style="display: block; padding: 0 10px"> background: #eee;
</span><span class="cx" style="display: block; padding: 0 10px"> border: 1px solid #999;
</span></span></pre></div>
<a id="trunksrcwpadminjscustomizecontrolsjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/js/customize-controls.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/js/customize-controls.js 2016-10-21 05:59:34 UTC (rev 38852)
+++ trunk/src/wp-admin/js/customize-controls.js 2016-10-21 06:36:57 UTC (rev 38853)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1004,6 +1004,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> content.addClass( 'open' );
</span><span class="cx" style="display: block; padding: 0 10px"> overlay.addClass( 'section-open' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ api.state( 'expandedSection' ).set( section );
</ins><span class="cx" style="display: block; padding: 0 10px"> }, this );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1042,6 +1043,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> content.removeClass( 'open' );
</span><span class="cx" style="display: block; padding: 0 10px"> overlay.removeClass( 'section-open' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( section === api.state( 'expandedSection' ).get() ) {
+ api.state( 'expandedSection' ).set( false );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( args.completeCallback ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1995,6 +1999,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> overlay.addClass( 'in-sub-panel' );
</span><span class="cx" style="display: block; padding: 0 10px"> accordionSection.addClass( 'current-panel' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ api.state( 'expandedPanel' ).set( panel );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> } else if ( ! expanded && accordionSection.hasClass( 'current-panel' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> panel._animateChangeExpanded( function() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2011,6 +2016,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> overlay.removeClass( 'in-sub-panel' );
</span><span class="cx" style="display: block; padding: 0 10px"> accordionSection.removeClass( 'current-panel' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( panel === api.state( 'expandedPanel' ).get() ) {
+ api.state( 'expandedPanel' ).set( false );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4968,6 +4976,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> activated = state.create( 'activated' ),
</span><span class="cx" style="display: block; padding: 0 10px"> processing = state.create( 'processing' ),
</span><span class="cx" style="display: block; padding: 0 10px"> paneVisible = state.create( 'paneVisible' ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ expandedPanel = state.create( 'expandedPanel' ),
+ expandedSection = state.create( 'expandedSection' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> changesetStatus = state.create( 'changesetStatus' ),
</span><span class="cx" style="display: block; padding: 0 10px"> previewerAlive = state.create( 'previewerAlive' ),
</span><span class="cx" style="display: block; padding: 0 10px"> populateChangesetUuidParam;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5003,6 +5013,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> activated( api.settings.theme.active );
</span><span class="cx" style="display: block; padding: 0 10px"> processing( 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> paneVisible( true );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ expandedPanel( false );
+ expandedSection( false );
</ins><span class="cx" style="display: block; padding: 0 10px"> previewerAlive( true );
</span><span class="cx" style="display: block; padding: 0 10px"> changesetStatus( api.settings.changeset.status );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5156,6 +5168,165 @@
</span><span class="cx" style="display: block; padding: 0 10px"> overlay.toggleClass( 'preview-only' );
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Sticky header feature.
+ */
+ (function initStickyHeaders() {
+ var parentContainer = $( '.wp-full-overlay-sidebar-content' ),
+ changeContainer, getHeaderHeight, releaseStickyHeader, resetStickyHeader, positionStickyHeader,
+ activeHeader, lastScrollTop;
+
+ // Determine which panel or section is currently expanded.
+ changeContainer = function( container ) {
+ var newInstance = container,
+ expandedSection = api.state( 'expandedSection' ).get(),
+ expandedPanel = api.state( 'expandedPanel' ).get(),
+ headerElement;
+
+ // Release previously active header element.
+ if ( activeHeader && activeHeader.element ) {
+ releaseStickyHeader( activeHeader.element );
+ }
+
+ if ( ! newInstance ) {
+ if ( ! expandedSection && expandedPanel && expandedPanel.contentContainer ) {
+ newInstance = expandedPanel;
+ } else if ( ! expandedPanel && expandedSection && expandedSection.contentContainer ) {
+ newInstance = expandedSection;
+ } else {
+ activeHeader = false;
+ return;
+ }
+ }
+
+ headerElement = newInstance.contentContainer.find( '.customize-section-title, .panel-meta' ).first();
+ if ( headerElement.length ) {
+ activeHeader = {
+ instance: newInstance,
+ element: headerElement,
+ parent: headerElement.closest( '.customize-pane-child' ),
+ height: getHeaderHeight( headerElement )
+ };
+ if ( expandedSection ) {
+ resetStickyHeader( activeHeader.element, activeHeader.parent );
+ }
+ } else {
+ activeHeader = false;
+ }
+ };
+ api.state( 'expandedSection' ).bind( changeContainer );
+ api.state( 'expandedPanel' ).bind( changeContainer );
+
+ // Throttled scroll event handler.
+ parentContainer.on( 'scroll', _.throttle( function() {
+ if ( ! activeHeader ) {
+ return;
+ }
+
+ var scrollTop = parentContainer.scrollTop(),
+ isScrollingUp = ( lastScrollTop ) ? scrollTop <= lastScrollTop : true;
+
+ lastScrollTop = scrollTop;
+ positionStickyHeader( activeHeader, scrollTop, isScrollingUp );
+ }, 8 ) );
+
+ // Release header element if it is sticky.
+ releaseStickyHeader = function( headerElement ) {
+ if ( ! headerElement.hasClass( 'is-sticky' ) ) {
+ return;
+ }
+ headerElement
+ .removeClass( 'is-sticky' )
+ .addClass( 'maybe-sticky is-in-view' )
+ .css( 'top', parentContainer.scrollTop() + 'px' );
+ };
+
+ // Reset position of the sticky header.
+ resetStickyHeader = function( headerElement, headerParent ) {
+ headerElement
+ .removeClass( 'maybe-sticky is-in-view' )
+ .css( {
+ width: '',
+ top: ''
+ } );
+ headerParent.css( 'padding-top', '' );
+ };
+
+ // Get header height.
+ getHeaderHeight = function( headerElement ) {
+ var height = headerElement.data( 'height' );
+ if ( ! height ) {
+ height = headerElement.outerHeight();
+ headerElement.data( 'height', height );
+ }
+ return height;
+ };
+
+ // Reposition header on throttled `scroll` event.
+ positionStickyHeader = function( header, scrollTop, isScrollingUp ) {
+ var headerElement = header.element,
+ headerParent = header.parent,
+ headerHeight = header.height,
+ headerTop = parseInt( headerElement.css( 'top' ), 10 ),
+ maybeSticky = headerElement.hasClass( 'maybe-sticky' ),
+ isSticky = headerElement.hasClass( 'is-sticky' ),
+ isInView = headerElement.hasClass( 'is-in-view' );
+
+ // When scrolling down, gradually hide sticky header.
+ if ( ! isScrollingUp ) {
+ if ( isSticky ) {
+ headerTop = scrollTop;
+ headerElement
+ .removeClass( 'is-sticky' )
+ .css( {
+ top: headerTop + 'px',
+ width: ''
+ } );
+ }
+ if ( isInView && scrollTop > headerTop + headerHeight ) {
+ headerElement.removeClass( 'is-in-view' );
+ headerParent.css( 'padding-top', '' );
+ }
+ return;
+ }
+
+ // Scrolling up.
+ if ( ! maybeSticky && scrollTop >= headerHeight ) {
+ maybeSticky = true;
+ headerElement.addClass( 'maybe-sticky' );
+ } else if ( 0 === scrollTop ) {
+ // Reset header in base position.
+ headerElement
+ .removeClass( 'maybe-sticky is-in-view is-sticky' )
+ .css( {
+ top: '',
+ width: ''
+ } );
+ headerParent.css( 'padding-top', '' );
+ return;
+ }
+
+ if ( isInView && ! isSticky ) {
+ // Header is in the view but is not yet sticky.
+ if ( headerTop >= scrollTop ) {
+ // Header is fully visible.
+ headerElement
+ .addClass( 'is-sticky' )
+ .css( {
+ top: '',
+ width: headerParent.outerWidth() + 'px'
+ } );
+ }
+ } else if ( maybeSticky && ! isInView ) {
+ // Header is out of the view.
+ headerElement
+ .addClass( 'is-in-view' )
+ .css( 'top', ( scrollTop - headerHeight ) + 'px' );
+ headerParent.css( 'padding-top', headerHeight + 'px' );
+ }
+ };
+ }());
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // Previewed device bindings.
</span><span class="cx" style="display: block; padding: 0 10px"> api.previewedDevice = new api.Value();
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre>
</div>
</div>
</body>
</html>