<!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>[41621] trunk/src/wp-admin: Accessibility: Improve the sidebar toggles in the Widgets screen.</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/41621">41621</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/41621","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>afercia</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2017-09-27 16:28:59 +0000 (Wed, 27 Sep 2017)</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'>Accessibility: Improve the sidebar toggles in the Widgets screen.
- uses button elements for the toggles
- uses `aria-expanded` on the toggles to communicate to assistive technologies the panels expanded/collapsed state
- adds the "circular focus" style to the toggles to give users a clear indication of the currently focused element
- standardizes CSS class names to `.toggle-indicator` and `.handlediv` as these names are already used across the admin for similar controls
Props monikarao, xavortm, mihai2u, Kopepasah.
Fixes <a href="https://core.trac.wordpress.org/ticket/37013">#37013</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadmincsscommoncss">trunk/src/wp-admin/css/common.css</a></li>
<li><a href="#trunksrcwpadmincsswidgetscss">trunk/src/wp-admin/css/widgets.css</a></li>
<li><a href="#trunksrcwpadminincludeswidgetsphp">trunk/src/wp-admin/includes/widgets.php</a></li>
<li><a href="#trunksrcwpadminjswidgetsjs">trunk/src/wp-admin/js/widgets.js</a></li>
<li><a href="#trunksrcwpadminwidgetsphp">trunk/src/wp-admin/widgets.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadmincsscommoncss"></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/common.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/css/common.css 2017-09-27 16:21:24 UTC (rev 41620)
+++ trunk/src/wp-admin/css/common.css 2017-09-27 16:28:59 UTC (rev 41621)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2966,7 +2966,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"> /* Metabox collapse arrow indicators */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.js .sidebar-name .sidebar-name-arrow:before,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.sidebar-name .toggle-indicator:before,
</ins><span class="cx" style="display: block; padding: 0 10px"> .js .meta-box-sortables .postbox .toggle-indicator:before,
</span><span class="cx" style="display: block; padding: 0 10px"> .bulk-action-notice .toggle-indicator:before {
</span><span class="cx" style="display: block; padding: 0 10px"> content: "\f142";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2978,26 +2978,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> text-decoration: none !important;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.js .widgets-holder-wrap.closed .sidebar-name-arrow:before,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.js .widgets-holder-wrap.closed .toggle-indicator:before,
</ins><span class="cx" style="display: block; padding: 0 10px"> .js .meta-box-sortables .postbox.closed .handlediv .toggle-indicator:before,
</span><span class="cx" style="display: block; padding: 0 10px"> .bulk-action-notice .bulk-action-errors-collapsed .toggle-indicator:before {
</span><span class="cx" style="display: block; padding: 0 10px"> content: "\f140";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.js .sidebar-name .sidebar-name-arrow:before {
- padding: 10px;
- left: 0;
-}
-
-.js #widgets-left .sidebar-name .sidebar-name-arrow {
- display: none;
-}
-
-.js #widgets-left .widgets-holder-wrap.closed .sidebar-name .sidebar-name-arrow,
-.js #widgets-left .sidebar-name:hover .sidebar-name-arrow {
- display: block;
-}
-
</del><span class="cx" style="display: block; padding: 0 10px"> .js .postbox .handlediv .toggle-indicator:before {
</span><span class="cx" style="display: block; padding: 0 10px"> margin-top: 4px;
</span><span class="cx" style="display: block; padding: 0 10px"> width: 20px;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3171,7 +3157,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .handlediv,
</span><span class="cx" style="display: block; padding: 0 10px"> .postbox .handlediv.button-link,
</span><span class="cx" style="display: block; padding: 0 10px"> .item-edit,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.sidebar-name-arrow,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.toggle-indicator,
</ins><span class="cx" style="display: block; padding: 0 10px"> .accordion-section-title:after {
</span><span class="cx" style="display: block; padding: 0 10px"> color: #72777c;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3188,7 +3174,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .postbox .handlediv.button-link:focus,
</span><span class="cx" style="display: block; padding: 0 10px"> .item-edit:hover,
</span><span class="cx" style="display: block; padding: 0 10px"> .item-edit:focus,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.sidebar-name:hover .sidebar-name-arrow,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.sidebar-name:hover .toggle-indicator,
</ins><span class="cx" style="display: block; padding: 0 10px"> .accordion-section-title:hover:after {
</span><span class="cx" style="display: block; padding: 0 10px"> color: #23282d;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3488,8 +3474,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> #screen-meta-links a.show-settings,
</span><span class="cx" style="display: block; padding: 0 10px"> .widget-top .widget-action,
</span><span class="cx" style="display: block; padding: 0 10px"> .widget-top .widget-action:hover,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- .sidebar-name-arrow,
- .sidebar-name:hover .sidebar-name-arrow,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ .sidebar-name .toggle-indicator,
+ .sidebar-name:hover .toggle-indicator,
</ins><span class="cx" style="display: block; padding: 0 10px"> .meta-box-sortables .postbox:hover .handlediv,
</span><span class="cx" style="display: block; padding: 0 10px"> #bulk-titles div a,
</span><span class="cx" style="display: block; padding: 0 10px"> #bulk-titles div a:hover {
</span></span></pre></div>
<a id="trunksrcwpadmincsswidgetscss"></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/widgets.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/css/widgets.css 2017-09-27 16:21:24 UTC (rev 41620)
+++ trunk/src/wp-admin/css/widgets.css 2017-09-27 16:28:59 UTC (rev 41621)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -260,17 +260,52 @@
</span><span class="cx" style="display: block; padding: 0 10px"> box-sizing: border-box;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.sidebar-name-arrow {
- position: absolute;
- top: 0;
- right: 0;
- bottom: 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.js .sidebar-name {
+ cursor: pointer;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.js .sidebar-name {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.sidebar-name .handlediv {
+ float: right;
+ width: 38px;
+ height: 38px;
+ border: 0;
+ margin: 0;
+ padding: 8px;
+ background: none;
</ins><span class="cx" style="display: block; padding: 0 10px"> cursor: pointer;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ outline: none;
</ins><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">+#widgets-right .sidebar-name .handlediv {
+ margin: 5px 3px 0 0;
+}
+
+.sidebar-name .handlediv:focus {
+ box-shadow: none;
+ outline: none;
+}
+
+#widgets-left .sidebar-name .toggle-indicator {
+ display: none;
+}
+
+#widgets-left .widgets-holder-wrap.closed .sidebar-name .toggle-indicator,
+#widgets-left .sidebar-name:hover .toggle-indicator,
+#widgets-left .sidebar-name .handlediv:focus .toggle-indicator {
+ display: block;
+}
+
+.sidebar-name .toggle-indicator:before {
+ padding: 1px 2px 1px 0;
+ border-radius: 50%;
+}
+
+.sidebar-name .handlediv:focus .toggle-indicator:before {
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, .8);
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> .sidebar-name h2,
</span><span class="cx" style="display: block; padding: 0 10px"> .sidebar-name h3 {
</span><span class="cx" style="display: block; padding: 0 10px"> margin: 0;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -325,10 +360,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> margin: 0 10px 0 0;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-#widgets-left .sidebar-name .sidebar-name-arrow:before {
- padding: 9px;
-}
-
</del><span class="cx" style="display: block; padding: 0 10px"> #widgets-left .widgets-holder-wrap,
</span><span class="cx" style="display: block; padding: 0 10px"> div#widgets-left .widget-holder {
</span><span class="cx" style="display: block; padding: 0 10px"> background: transparent;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -423,10 +454,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> padding: 15px 7px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-div#widgets-right .sidebar-name .sidebar-name-arrow:before {
- top: 2px;
-}
-
</del><span class="cx" style="display: block; padding: 0 10px"> div#widgets-right .widget-top {
</span><span class="cx" style="display: block; padding: 0 10px"> padding: 0;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -556,7 +583,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .widget-control-noform,
</span><span class="cx" style="display: block; padding: 0 10px"> #access-off,
</span><span class="cx" style="display: block; padding: 0 10px"> .widgets_access .widget-action,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.widgets_access .sidebar-name-arrow,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.widgets_access .handlediv,
</ins><span class="cx" style="display: block; padding: 0 10px"> .widgets_access #access-on,
</span><span class="cx" style="display: block; padding: 0 10px"> .widgets_access .widget-holder .description,
</span><span class="cx" style="display: block; padding: 0 10px"> .no-js .widget-holder .description {
</span></span></pre></div>
<a id="trunksrcwpadminincludeswidgetsphp"></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/includes/widgets.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/widgets.php 2017-09-27 16:21:24 UTC (rev 41620)
+++ trunk/src/wp-admin/includes/widgets.php 2017-09-27 16:28:59 UTC (rev 41621)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -80,7 +80,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $sidebar_name ) {
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="sidebar-name">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="sidebar-name-arrow"><br /></div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <button type="button" class="handlediv hide-if-no-js" aria-expanded="true">
+ <span class="screen-reader-text"><?php echo esc_html( $sidebar_name ); ?></span>
+ <span class="toggle-indicator" aria-hidden="true"></span>
+ </button>
</ins><span class="cx" style="display: block; padding: 0 10px"> <h2><?php echo esc_html( $sidebar_name ); ?> <span class="spinner"></span></h2>
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span></span></pre></div>
<a id="trunksrcwpadminjswidgetsjs"></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/widgets.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/js/widgets.js 2017-09-27 16:21:24 UTC (rev 41620)
+++ trunk/src/wp-admin/js/widgets.js 2017-09-27 16:28:59 UTC (rev 41621)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,20 +39,43 @@
</span><span class="cx" style="display: block; padding: 0 10px"> sidebars = $('div.widgets-sortables'),
</span><span class="cx" style="display: block; padding: 0 10px"> isRTL = !! ( 'undefined' !== typeof isRtl && isRtl );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $('#widgets-right .sidebar-name').click( function() {
- var $this = $(this),
- $wrap = $this.closest('.widgets-holder-wrap');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Handle the widgets containers in the right column.
+ $( '#widgets-right .sidebar-name' )
+ /*
+ * Toggle the widgets containers when clicked and update the toggle
+ * button `aria-expanded` attribute value.
+ */
+ .click( function() {
+ var $this = $( this ),
+ $wrap = $this.closest( '.widgets-holder-wrap '),
+ $toggle = $this.find( '.handlediv' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $wrap.hasClass('closed') ) {
- $wrap.removeClass('closed');
- $this.parent().sortable('refresh');
- } else {
- $wrap.addClass('closed');
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $wrap.hasClass( 'closed' ) ) {
+ $wrap.removeClass( 'closed' );
+ $toggle.attr( 'aria-expanded', 'true' );
+ // Refresh the jQuery UI sortable items.
+ $this.parent().sortable( 'refresh' );
+ } else {
+ $wrap.addClass( 'closed' );
+ $toggle.attr( 'aria-expanded', 'false' );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $document.triggerHandler( 'wp-pin-menu' );
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Update the admin menu "sticky" state.
+ $document.triggerHandler( 'wp-pin-menu' );
+ })
+ /*
+ * Set the initial `aria-expanded` attribute value on the widgets
+ * containers toggle button. The first one is expanded by default.
+ */
+ .find( '.handlediv' ).each( function( index ) {
+ if ( 0 === index ) {
+ // jQuery equivalent of `continue` within an `each()` loop.
+ return;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $( this ).attr( 'aria-expanded', 'false' );
+ });
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // Show AYS dialog when there are unsaved widget changes.
</span><span class="cx" style="display: block; padding: 0 10px"> $( window ).on( 'beforeunload.widgets', function( event ) {
</span><span class="cx" style="display: block; padding: 0 10px"> var dirtyWidgetIds = [], unsavedWidgetsElements;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -86,8 +109,15 @@
</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">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $('#widgets-left .sidebar-name').click( function() {
- $(this).closest('.widgets-holder-wrap').toggleClass('closed');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Handle the widgets containers in the left column.
+ $( '#widgets-left .sidebar-name' ).click( function() {
+ var $wrap = $( this ).closest( '.widgets-holder-wrap' );
+
+ $wrap
+ .toggleClass( 'closed' )
+ .find( '.handlediv' ).attr( 'aria-expanded', ! $wrap.hasClass( 'closed' ) );
+
+ // Update the admin menu "sticky" state.
</ins><span class="cx" style="display: block; padding: 0 10px"> $document.triggerHandler( 'wp-pin-menu' );
</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">@@ -215,7 +245,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Open Sidebar when a Widget gets dragged over it.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param event
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param {object} event jQuery event object.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> over: function( event ) {
</span><span class="cx" style="display: block; padding: 0 10px"> var $wrap = $( event.target ).parent();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -227,7 +257,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $wrap.hasClass( 'closed' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wpWidgets.hoveredSidebar = $wrap;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $wrap.removeClass( 'closed' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $wrap
+ .removeClass( 'closed' )
+ .find( '.handlediv' ).attr( 'aria-expanded', 'true' );
</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"> $( this ).sortable( 'refresh' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -236,7 +268,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Close Sidebar when the Widget gets dragged out of it.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param event
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param {object} event jQuery event object.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> out: function( event ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( wpWidgets.hoveredSidebar ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -319,7 +351,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $sidebar = $widget.parent();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $sidebar.parent().hasClass('closed') ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $sidebar.parent().removeClass('closed');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $sidebar.parent()
+ .removeClass( 'closed' )
+ .find( '.handlediv' ).attr( 'aria-expanded', 'true' );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $children = $sidebar.children('.widget');
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure the dropped widget is at the top
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -622,8 +657,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $( '#' + widgetId ).hide();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Open the widgets container
- sidebar.closest( '.widgets-holder-wrap' ).removeClass('closed');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Open the widgets container.
+ sidebar.closest( '.widgets-holder-wrap' )
+ .removeClass( 'closed' )
+ .find( '.handlediv' ).attr( 'aria-expanded', 'true' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> sidebar.append( widget );
</span><span class="cx" style="display: block; padding: 0 10px"> sidebar.sortable('refresh');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -679,11 +716,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * Used when a Widget gets dragged in/out of the Sidebar and never dropped.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param sidebar
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param {object} event jQuery event object.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- closeSidebar: function( sidebar ) {
- this.hoveredSidebar.addClass( 'closed' );
- $( sidebar.target ).css( 'min-height', '' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ closeSidebar: function( event ) {
+ this.hoveredSidebar
+ .addClass( 'closed' )
+ .find( '.handlediv' ).attr( 'aria-expanded', 'false' );
+
+ $( event.target ).css( 'min-height', '' );
</ins><span class="cx" style="display: block; padding: 0 10px"> this.hoveredSidebar = null;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span></span></pre></div>
<a id="trunksrcwpadminwidgetsphp"></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/widgets.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/widgets.php 2017-09-27 16:21:24 UTC (rev 41620)
+++ trunk/src/wp-admin/widgets.php 2017-09-27 16:28:59 UTC (rev 41621)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -387,7 +387,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <div id="widgets-left">
</span><span class="cx" style="display: block; padding: 0 10px"> <div id="available-widgets" class="widgets-holder-wrap">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="sidebar-name">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="sidebar-name-arrow"><br /></div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <button type="button" class="handlediv hide-if-no-js" aria-expanded="true">
+ <span class="screen-reader-text"><?php _e( 'Available Widgets' ); ?></span>
+ <span class="toggle-indicator" aria-hidden="true"></span>
+ </button>
</ins><span class="cx" style="display: block; padding: 0 10px"> <h2><?php _e( 'Available Widgets' ); ?> <span id="removing-widget"><?php _ex( 'Deactivate', 'removing-widget' ); ?> <span></span></span></h2>
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="widget-holder">
</span></span></pre>
</div>
</div>
</body>
</html>