From f4c3b8352e090c7120cb66fa4229a7391e6d9b4a Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Fri, 4 Nov 2016 17:16:26 +0000 Subject: [PATCH] Customize: Use `button` with `svg` as click target instead of `:before` content, improving clickability of edit shortcuts in Firefox. Props sirbrillig, celloexpressions, delawski. See #38532. Built from https://develop.svn.wordpress.org/trunk@39136 git-svn-id: http://core.svn.wordpress.org/trunk@39076 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentyfourteen/style.css | 4 +- .../twentyseventeen/inc/color-patterns.php | 2 +- wp-content/themes/twentyseventeen/style.css | 4 +- wp-includes/css/customize-preview-rtl.css | 40 ++++++++++++------- wp-includes/css/customize-preview-rtl.min.css | 2 +- wp-includes/css/customize-preview.css | 40 ++++++++++++------- wp-includes/css/customize-preview.min.css | 2 +- wp-includes/js/customize-selective-refresh.js | 21 ++++++---- .../js/customize-selective-refresh.min.js | 2 +- wp-includes/version.php | 2 +- 10 files changed, 75 insertions(+), 44 deletions(-) diff --git a/wp-content/themes/twentyfourteen/style.css b/wp-content/themes/twentyfourteen/style.css index 72b320f79d..d5c2c2f909 100644 --- a/wp-content/themes/twentyfourteen/style.css +++ b/wp-content/themes/twentyfourteen/style.css @@ -1045,8 +1045,8 @@ span + .edit-link:before, outline: 1px dotted; } -.secondary-navigation .customize-partial-edit-shortcut:before, -.footer-sidebar .widget:first-child .customize-partial-edit-shortcut:before { +.secondary-navigation .customize-partial-edit-shortcut button, +.footer-sidebar .widget:first-child .customize-partial-edit-shortcut button { left: 0; } diff --git a/wp-content/themes/twentyseventeen/inc/color-patterns.php b/wp-content/themes/twentyseventeen/inc/color-patterns.php index d14e0b1f7f..0a20a035cf 100644 --- a/wp-content/themes/twentyseventeen/inc/color-patterns.php +++ b/wp-content/themes/twentyseventeen/inc/color-patterns.php @@ -317,7 +317,7 @@ body.colors-custom, .colors-custom .next.page-numbers:hover, .colors-custom .site-content .wp-playlist-light .wp-playlist-item:hover, .colors-custom .site-content .wp-playlist-light .wp-playlist-item:focus, -.colors-custom .customize-partial-edit-shortcut:before { +.colors-custom .customize-partial-edit-shortcut button { background: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 46% ); /* base: #767676; */ } diff --git a/wp-content/themes/twentyseventeen/style.css b/wp-content/themes/twentyseventeen/style.css index a1fbe7254d..74ee483694 100644 --- a/wp-content/themes/twentyseventeen/style.css +++ b/wp-content/themes/twentyseventeen/style.css @@ -2967,7 +2967,7 @@ object { } /* Add some space around the visual edit shortcut buttons. */ -.twentyseventeen-panel .customize-partial-edit-shortcut:before { +.twentyseventeen-panel .customize-partial-edit-shortcut button { top: 30px; left: 30px; } @@ -2983,7 +2983,7 @@ object { } /* Prevent icon colors from clashing with color schemes. */ -.colors-custom .customize-partial-edit-shortcut:before { +.colors-custom .customize-partial-edit-shortcut button { text-shadow: 0 -1px 1px rgba(0,0,0,.2), 1px 0 1px rgba(0,0,0,.2), 0 1px 1px rgba(0,0,0,.2), diff --git a/wp-includes/css/customize-preview-rtl.css b/wp-includes/css/customize-preview-rtl.css index 516a247798..72b078f2cd 100644 --- a/wp-includes/css/customize-preview-rtl.css +++ b/wp-includes/css/customize-preview-rtl.css @@ -12,9 +12,9 @@ } /* Make shortcut buttons essentially invisible */ -.widget button.customize-partial-edit-shortcut, +.widget .customize-partial-edit-shortcut, .customize-partial-edit-shortcut { - position: relative; + position: absolute; float: right; width: 1px; /* required to have a size to be focusable in Safari */ height: 1px; @@ -28,23 +28,26 @@ z-index: 5; } -.customize-partial-edit-shortcut:active { +.widget .customize-partial-edit-shortcut button:active, +.customize-partial-edit-shortcut button:active { padding: 0; border: 0; } /* Styles for the actual shortcut */ -.customize-partial-edit-shortcut:before { +.widget .customize-partial-edit-shortcut button, +.customize-partial-edit-shortcut button { position: absolute; right: -36px; color: #fff; width: 30px; height: 30px; + min-width: 30px; + min-height: 30px; font-size: 18px; - font-family: dashicons; - content: '\f464'; z-index: 5; background-color: #0085ba; + background: #0085ba; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 2px 1px rgba(46,68,83,0.15); @@ -65,27 +68,36 @@ 1px 0 1px #006799; } -.customize-partial-edit-shortcut:hover:before, -.customize-partial-edit-shortcut:focus:before { +.customize-partial-edit-shortcut button svg { + fill: #fff; + min-width: 20px; + min-height: 20px; + width: 20px; + height: 20px; + margin: auto; +} + +.customize-partial-edit-shortcut button:hover, +.customize-partial-edit-shortcut button:focus { background: #008ec2; /* matches primary buttons */ border-color: #191e23; /* provides visual focus style with 4.5 contrast against background color */ } -body.customize-partial-edit-shortcuts-shown .customize-partial-edit-shortcut:before { +body.customize-partial-edit-shortcuts-shown .customize-partial-edit-shortcut button { animation-name: customize-partial-edit-shortcut-bounce-appear; pointer-events: auto; } -body.customize-partial-edit-shortcuts-hidden .customize-partial-edit-shortcut:before { +body.customize-partial-edit-shortcuts-hidden .customize-partial-edit-shortcut button { animation-name: customize-partial-edit-shortcut-bounce-disappear; pointer-events: none; } -.page-sidebar-collapsed .customize-partial-edit-shortcut:before, -.customize-partial-edit-shortcut-hidden:before { +.page-sidebar-collapsed .customize-partial-edit-shortcut button, +.customize-partial-edit-shortcut-hidden .customize-partial-edit-shortcut button { visibility: hidden; } -.customize-partial-edit-shortcut-left-margin:before { +.customize-partial-edit-shortcut-left-margin.customize-partial-edit-shortcut button { right: 0; } @@ -144,7 +156,7 @@ body.customize-partial-edit-shortcuts-hidden .customize-partial-edit-shortcut:be } @media screen and (max-width:800px) { - .customize-partial-edit-shortcut:before { + .customize-partial-edit-shortcut button { right: -18px; /* Assume there will be less of a margin available on smaller screens */ } } diff --git a/wp-includes/css/customize-preview-rtl.min.css b/wp-includes/css/customize-preview-rtl.min.css index 71ce256506..f5e38a9016 100644 --- a/wp-includes/css/customize-preview-rtl.min.css +++ b/wp-includes/css/customize-preview-rtl.min.css @@ -1 +1 @@ -.customize-partial-refreshing{opacity:.25;-webkit-transition:opacity .25s;transition:opacity .25s;cursor:progress}.customize-partial-refreshing.widget-customizer-highlighted-widget{-webkit-box-shadow:none;box-shadow:none}.customize-partial-edit-shortcut,.widget button.customize-partial-edit-shortcut{position:relative;float:right;width:1px;height:1px;padding:0;margin:-1px -1px 0 0;border:0;background:0 0;color:transparent;box-shadow:none;outline:0;z-index:5}.customize-partial-edit-shortcut:active{padding:0;border:0}.customize-partial-edit-shortcut:before{position:absolute;right:-36px;color:#fff;width:30px;height:30px;font-size:18px;font-family:dashicons;content:'\f464';z-index:5;background-color:#0085ba;border-radius:50%;border:2px solid #fff;box-shadow:0 2px 1px rgba(46,68,83,.15);text-align:center;display:flex;flex-direction:row;justify-content:center;align-items:center;cursor:pointer;padding:0;animation-fill-mode:both;animation-duration:.4s;opacity:0;pointer-events:none;text-shadow:0 -1px 1px #006799,-1px 0 1px #006799,0 1px 1px #006799,1px 0 1px #006799}.customize-partial-edit-shortcut:focus:before,.customize-partial-edit-shortcut:hover:before{background:#008ec2;border-color:#191e23}body.customize-partial-edit-shortcuts-shown .customize-partial-edit-shortcut:before{animation-name:customize-partial-edit-shortcut-bounce-appear;pointer-events:auto}body.customize-partial-edit-shortcuts-hidden .customize-partial-edit-shortcut:before{animation-name:customize-partial-edit-shortcut-bounce-disappear;pointer-events:none}.customize-partial-edit-shortcut-hidden:before,.page-sidebar-collapsed .customize-partial-edit-shortcut:before{visibility:hidden}.customize-partial-edit-shortcut-left-margin:before{right:0}@keyframes customize-partial-edit-shortcut-bounce-appear{20%,40%,60%,80%,from,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:scale3d(.3,.3,.3)}20%{transform:scale3d(1.1,1.1,1.1)}40%{transform:scale3d(.9,.9,.9)}60%{opacity:1;transform:scale3d(1.03,1.03,1.03)}80%{transform:scale3d(.97,.97,.97)}to{opacity:1;transform:scale3d(1,1,1)}}@keyframes customize-partial-edit-shortcut-bounce-disappear{20%,40%,60%,80%,from,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:1;transform:scale3d(1,1,1)}20%{transform:scale3d(.97,.97,.97)}40%{opacity:1;transform:scale3d(1.03,1.03,1.03)}60%{transform:scale3d(.9,.9,.9)}80%{transform:scale3d(1.1,1.1,1.1)}to{opacity:0;transform:scale3d(.3,.3,.3)}}@media screen and (max-width:800px){.customize-partial-edit-shortcut:before{right:-18px}} \ No newline at end of file +.customize-partial-refreshing{opacity:.25;-webkit-transition:opacity .25s;transition:opacity .25s;cursor:progress}.customize-partial-refreshing.widget-customizer-highlighted-widget{-webkit-box-shadow:none;box-shadow:none}.customize-partial-edit-shortcut,.widget .customize-partial-edit-shortcut{position:absolute;float:right;width:1px;height:1px;padding:0;margin:-1px -1px 0 0;border:0;background:0 0;color:transparent;box-shadow:none;outline:0;z-index:5}.customize-partial-edit-shortcut button:active,.widget .customize-partial-edit-shortcut button:active{padding:0;border:0}.customize-partial-edit-shortcut button,.widget .customize-partial-edit-shortcut button{position:absolute;right:-36px;color:#fff;width:30px;height:30px;min-width:30px;min-height:30px;font-size:18px;z-index:5;background:#0085ba;border-radius:50%;border:2px solid #fff;box-shadow:0 2px 1px rgba(46,68,83,.15);text-align:center;display:flex;flex-direction:row;justify-content:center;align-items:center;cursor:pointer;padding:0;animation-fill-mode:both;animation-duration:.4s;opacity:0;pointer-events:none;text-shadow:0 -1px 1px #006799,-1px 0 1px #006799,0 1px 1px #006799,1px 0 1px #006799}.customize-partial-edit-shortcut button svg{fill:#fff;min-width:20px;min-height:20px;width:20px;height:20px;margin:auto}.customize-partial-edit-shortcut button:focus,.customize-partial-edit-shortcut button:hover{background:#008ec2;border-color:#191e23}body.customize-partial-edit-shortcuts-shown .customize-partial-edit-shortcut button{animation-name:customize-partial-edit-shortcut-bounce-appear;pointer-events:auto}body.customize-partial-edit-shortcuts-hidden .customize-partial-edit-shortcut button{animation-name:customize-partial-edit-shortcut-bounce-disappear;pointer-events:none}.customize-partial-edit-shortcut-hidden .customize-partial-edit-shortcut button,.page-sidebar-collapsed .customize-partial-edit-shortcut button{visibility:hidden}.customize-partial-edit-shortcut-left-margin.customize-partial-edit-shortcut button{right:0}@keyframes customize-partial-edit-shortcut-bounce-appear{20%,40%,60%,80%,from,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:scale3d(.3,.3,.3)}20%{transform:scale3d(1.1,1.1,1.1)}40%{transform:scale3d(.9,.9,.9)}60%{opacity:1;transform:scale3d(1.03,1.03,1.03)}80%{transform:scale3d(.97,.97,.97)}to{opacity:1;transform:scale3d(1,1,1)}}@keyframes customize-partial-edit-shortcut-bounce-disappear{20%,40%,60%,80%,from,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:1;transform:scale3d(1,1,1)}20%{transform:scale3d(.97,.97,.97)}40%{opacity:1;transform:scale3d(1.03,1.03,1.03)}60%{transform:scale3d(.9,.9,.9)}80%{transform:scale3d(1.1,1.1,1.1)}to{opacity:0;transform:scale3d(.3,.3,.3)}}@media screen and (max-width:800px){.customize-partial-edit-shortcut button{right:-18px}} \ No newline at end of file diff --git a/wp-includes/css/customize-preview.css b/wp-includes/css/customize-preview.css index fee3b7bf1d..ad219e4537 100644 --- a/wp-includes/css/customize-preview.css +++ b/wp-includes/css/customize-preview.css @@ -12,9 +12,9 @@ } /* Make shortcut buttons essentially invisible */ -.widget button.customize-partial-edit-shortcut, +.widget .customize-partial-edit-shortcut, .customize-partial-edit-shortcut { - position: relative; + position: absolute; float: left; width: 1px; /* required to have a size to be focusable in Safari */ height: 1px; @@ -28,23 +28,26 @@ z-index: 5; } -.customize-partial-edit-shortcut:active { +.widget .customize-partial-edit-shortcut button:active, +.customize-partial-edit-shortcut button:active { padding: 0; border: 0; } /* Styles for the actual shortcut */ -.customize-partial-edit-shortcut:before { +.widget .customize-partial-edit-shortcut button, +.customize-partial-edit-shortcut button { position: absolute; left: -36px; color: #fff; width: 30px; height: 30px; + min-width: 30px; + min-height: 30px; font-size: 18px; - font-family: dashicons; - content: '\f464'; z-index: 5; background-color: #0085ba; + background: #0085ba; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 2px 1px rgba(46,68,83,0.15); @@ -65,27 +68,36 @@ -1px 0 1px #006799; } -.customize-partial-edit-shortcut:hover:before, -.customize-partial-edit-shortcut:focus:before { +.customize-partial-edit-shortcut button svg { + fill: #fff; + min-width: 20px; + min-height: 20px; + width: 20px; + height: 20px; + margin: auto; +} + +.customize-partial-edit-shortcut button:hover, +.customize-partial-edit-shortcut button:focus { background: #008ec2; /* matches primary buttons */ border-color: #191e23; /* provides visual focus style with 4.5 contrast against background color */ } -body.customize-partial-edit-shortcuts-shown .customize-partial-edit-shortcut:before { +body.customize-partial-edit-shortcuts-shown .customize-partial-edit-shortcut button { animation-name: customize-partial-edit-shortcut-bounce-appear; pointer-events: auto; } -body.customize-partial-edit-shortcuts-hidden .customize-partial-edit-shortcut:before { +body.customize-partial-edit-shortcuts-hidden .customize-partial-edit-shortcut button { animation-name: customize-partial-edit-shortcut-bounce-disappear; pointer-events: none; } -.page-sidebar-collapsed .customize-partial-edit-shortcut:before, -.customize-partial-edit-shortcut-hidden:before { +.page-sidebar-collapsed .customize-partial-edit-shortcut button, +.customize-partial-edit-shortcut-hidden .customize-partial-edit-shortcut button { visibility: hidden; } -.customize-partial-edit-shortcut-left-margin:before { +.customize-partial-edit-shortcut-left-margin.customize-partial-edit-shortcut button { left: 0; } @@ -144,7 +156,7 @@ body.customize-partial-edit-shortcuts-hidden .customize-partial-edit-shortcut:be } @media screen and (max-width:800px) { - .customize-partial-edit-shortcut:before { + .customize-partial-edit-shortcut button { left: -18px; /* Assume there will be less of a margin available on smaller screens */ } } diff --git a/wp-includes/css/customize-preview.min.css b/wp-includes/css/customize-preview.min.css index 2191554a75..281b68bd8a 100644 --- a/wp-includes/css/customize-preview.min.css +++ b/wp-includes/css/customize-preview.min.css @@ -1 +1 @@ -.customize-partial-refreshing{opacity:.25;-webkit-transition:opacity .25s;transition:opacity .25s;cursor:progress}.customize-partial-refreshing.widget-customizer-highlighted-widget{-webkit-box-shadow:none;box-shadow:none}.customize-partial-edit-shortcut,.widget button.customize-partial-edit-shortcut{position:relative;float:left;width:1px;height:1px;padding:0;margin:-1px 0 0 -1px;border:0;background:0 0;color:transparent;box-shadow:none;outline:0;z-index:5}.customize-partial-edit-shortcut:active{padding:0;border:0}.customize-partial-edit-shortcut:before{position:absolute;left:-36px;color:#fff;width:30px;height:30px;font-size:18px;font-family:dashicons;content:'\f464';z-index:5;background-color:#0085ba;border-radius:50%;border:2px solid #fff;box-shadow:0 2px 1px rgba(46,68,83,.15);text-align:center;display:flex;flex-direction:row;justify-content:center;align-items:center;cursor:pointer;padding:0;animation-fill-mode:both;animation-duration:.4s;opacity:0;pointer-events:none;text-shadow:0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799,-1px 0 1px #006799}.customize-partial-edit-shortcut:focus:before,.customize-partial-edit-shortcut:hover:before{background:#008ec2;border-color:#191e23}body.customize-partial-edit-shortcuts-shown .customize-partial-edit-shortcut:before{animation-name:customize-partial-edit-shortcut-bounce-appear;pointer-events:auto}body.customize-partial-edit-shortcuts-hidden .customize-partial-edit-shortcut:before{animation-name:customize-partial-edit-shortcut-bounce-disappear;pointer-events:none}.customize-partial-edit-shortcut-hidden:before,.page-sidebar-collapsed .customize-partial-edit-shortcut:before{visibility:hidden}.customize-partial-edit-shortcut-left-margin:before{left:0}@keyframes customize-partial-edit-shortcut-bounce-appear{20%,40%,60%,80%,from,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:scale3d(.3,.3,.3)}20%{transform:scale3d(1.1,1.1,1.1)}40%{transform:scale3d(.9,.9,.9)}60%{opacity:1;transform:scale3d(1.03,1.03,1.03)}80%{transform:scale3d(.97,.97,.97)}to{opacity:1;transform:scale3d(1,1,1)}}@keyframes customize-partial-edit-shortcut-bounce-disappear{20%,40%,60%,80%,from,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:1;transform:scale3d(1,1,1)}20%{transform:scale3d(.97,.97,.97)}40%{opacity:1;transform:scale3d(1.03,1.03,1.03)}60%{transform:scale3d(.9,.9,.9)}80%{transform:scale3d(1.1,1.1,1.1)}to{opacity:0;transform:scale3d(.3,.3,.3)}}@media screen and (max-width:800px){.customize-partial-edit-shortcut:before{left:-18px}} \ No newline at end of file +.customize-partial-refreshing{opacity:.25;-webkit-transition:opacity .25s;transition:opacity .25s;cursor:progress}.customize-partial-refreshing.widget-customizer-highlighted-widget{-webkit-box-shadow:none;box-shadow:none}.customize-partial-edit-shortcut,.widget .customize-partial-edit-shortcut{position:absolute;float:left;width:1px;height:1px;padding:0;margin:-1px 0 0 -1px;border:0;background:0 0;color:transparent;box-shadow:none;outline:0;z-index:5}.customize-partial-edit-shortcut button:active,.widget .customize-partial-edit-shortcut button:active{padding:0;border:0}.customize-partial-edit-shortcut button,.widget .customize-partial-edit-shortcut button{position:absolute;left:-36px;color:#fff;width:30px;height:30px;min-width:30px;min-height:30px;font-size:18px;z-index:5;background:#0085ba;border-radius:50%;border:2px solid #fff;box-shadow:0 2px 1px rgba(46,68,83,.15);text-align:center;display:flex;flex-direction:row;justify-content:center;align-items:center;cursor:pointer;padding:0;animation-fill-mode:both;animation-duration:.4s;opacity:0;pointer-events:none;text-shadow:0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799,-1px 0 1px #006799}.customize-partial-edit-shortcut button svg{fill:#fff;min-width:20px;min-height:20px;width:20px;height:20px;margin:auto}.customize-partial-edit-shortcut button:focus,.customize-partial-edit-shortcut button:hover{background:#008ec2;border-color:#191e23}body.customize-partial-edit-shortcuts-shown .customize-partial-edit-shortcut button{animation-name:customize-partial-edit-shortcut-bounce-appear;pointer-events:auto}body.customize-partial-edit-shortcuts-hidden .customize-partial-edit-shortcut button{animation-name:customize-partial-edit-shortcut-bounce-disappear;pointer-events:none}.customize-partial-edit-shortcut-hidden .customize-partial-edit-shortcut button,.page-sidebar-collapsed .customize-partial-edit-shortcut button{visibility:hidden}.customize-partial-edit-shortcut-left-margin.customize-partial-edit-shortcut button{left:0}@keyframes customize-partial-edit-shortcut-bounce-appear{20%,40%,60%,80%,from,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:scale3d(.3,.3,.3)}20%{transform:scale3d(1.1,1.1,1.1)}40%{transform:scale3d(.9,.9,.9)}60%{opacity:1;transform:scale3d(1.03,1.03,1.03)}80%{transform:scale3d(.97,.97,.97)}to{opacity:1;transform:scale3d(1,1,1)}}@keyframes customize-partial-edit-shortcut-bounce-disappear{20%,40%,60%,80%,from,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:1;transform:scale3d(1,1,1)}20%{transform:scale3d(.97,.97,.97)}40%{opacity:1;transform:scale3d(1.03,1.03,1.03)}60%{transform:scale3d(.9,.9,.9)}80%{transform:scale3d(1.1,1.1,1.1)}to{opacity:0;transform:scale3d(.3,.3,.3)}}@media screen and (max-width:800px){.customize-partial-edit-shortcut button{left:-18px}} \ No newline at end of file diff --git a/wp-includes/js/customize-selective-refresh.js b/wp-includes/js/customize-selective-refresh.js index bfbb2ef2fa..2b8cbef73d 100644 --- a/wp-includes/js/customize-selective-refresh.js +++ b/wp-includes/js/customize-selective-refresh.js @@ -138,12 +138,13 @@ wp.customize.selectiveRefresh = ( function( $, api ) { * @returns {void} */ positionEditShortcut: function( placement, $editShortcut ) { - var $placementContainer = $( placement.container ); + var $placementContainer = $( placement.container ), $editButton; $placementContainer.prepend( $editShortcut ); if ( ! $placementContainer.is( ':visible' ) || 'none' === $placementContainer.css( 'display' ) ) { $editShortcut.addClass( 'customize-partial-edit-shortcut-hidden' ); } - $editShortcut.toggleClass( 'customize-partial-edit-shortcut-left-margin', $editShortcut.offset().left < 1 ); + $editButton = $editShortcut.find( 'button' ); + $editShortcut.toggleClass( 'customize-partial-edit-shortcut-left-margin', $editButton.offset().left < 2 ); }, /** @@ -214,14 +215,20 @@ wp.customize.selectiveRefresh = ( function( $, api ) { * @return {jQuery} The edit shortcut button element. */ createEditShortcut: function() { - var partial = this, shortcutTitle; + var partial = this, shortcutTitle, $buttonContainer, $button, $image; shortcutTitle = partial.getEditShortcutTitle(); - return $( ''),e.text(d),e.on("click",function(){b.selectiveRefresh.editShortcutVisibility.set("visible"===b.selectiveRefresh.editShortcutVisibility.get()?"hidden":"visible")}),f.prepend(e)),c.partial.each(function(a){a.deferred.ready.resolve()}),c.partial.bind("add",function(a){a.deferred.ready.resolve()})})}),c}(jQuery,wp.customize); \ No newline at end of file +wp.customize.selectiveRefresh=function(a,b){"use strict";var c,d,e;return c={ready:a.Deferred(),editShortcutVisibility:new b.Value,data:{partials:{},renderQueryVar:"",l10n:{shiftClickToEdit:""}},currentRequest:null},_.extend(c,b.Events),d=c.Partial=b.Class.extend({id:null,initialize:function(b,c){var d=this;c=c||{},d.id=b,d.params=_.extend({selector:null,settings:[],primarySetting:null,containerInclusive:!1,fallbackRefresh:!0},c.params||{}),d.deferred={},d.deferred.ready=a.Deferred(),d.deferred.ready.done(function(){d.ready()})},ready:function(){var b=this;_.each(b.placements(),function(d){a(d.container).attr("title",c.data.l10n.shiftClickToEdit),b.createEditShortcutForPlacement(d)}),a(document).on("click",b.params.selector,function(c){c.shiftKey&&(c.preventDefault(),_.each(b.placements(),function(d){a(d.container).is(c.currentTarget)&&b.showControl()}))})},createEditShortcutForPlacement:function(b){var c,d,e=this;b.container&&(d=a(b.container),d.length&&(c=e.createEditShortcut(),e.positionEditShortcut(b,c),c.on("click",function(a){a.preventDefault(),a.stopPropagation(),e.showControl()})))},positionEditShortcut:function(b,c){var d,e=a(b.container);e.prepend(c),e.is(":visible")&&"none"!==e.css("display")||c.addClass("customize-partial-edit-shortcut-hidden"),d=c.find("button"),c.toggleClass("customize-partial-edit-shortcut-left-margin",d.offset().left<2)},getEditShortcutClassName:function(){var a,b=this;return a=b.id.replace(/]/g,"").replace(/\[/g,"-"),"customize-partial-edit-shortcut-"+a},getEditShortcutTitle:function(){var a=this,b=c.data.l10n;switch(a.getType()){case"widget":return b.clickEditWidget;case"blogname":return b.clickEditTitle;case"blogdescription":return b.clickEditTitle;case"nav_menu":return b.clickEditMenu;default:return b.clickEditMisc}},getType:function(){var a,b=this;return a=b.params.primarySetting||_.first(b.settings())||"unknown",b.params.type?b.params.type:a.match(/^nav_menu_instance\[/)?"nav_menu":a.match(/^widget_.+\[\d+]$/)?"widget":a},createEditShortcut:function(){var b,c,d,e,f=this;return b=f.getEditShortcutTitle(),c=a("",{"class":"customize-partial-edit-shortcut "+f.getEditShortcutClassName()}),d=a("'),e.text(d),e.on("click",function(){b.selectiveRefresh.editShortcutVisibility.set("visible"===b.selectiveRefresh.editShortcutVisibility.get()?"hidden":"visible")}),f.prepend(e)),c.partial.each(function(a){a.deferred.ready.resolve()}),c.partial.bind("add",function(a){a.deferred.ready.resolve()})})}),c}(jQuery,wp.customize); \ No newline at end of file diff --git a/wp-includes/version.php b/wp-includes/version.php index dd9fc2cdf2..0c25e7d165 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-beta1-39135'; +$wp_version = '4.7-beta1-39136'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.