Skip to content

Commit 8fde41c

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-32947' into MAGETWO-31196
2 parents f62529b + d64d74b commit 8fde41c

File tree

10 files changed

+109
-17
lines changed

10 files changed

+109
-17
lines changed

app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/tree.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</div>
2424
<?php if ($this->getRoot()): ?>
2525
<div class="tree-holder">
26-
<div id="tree-div" style="width:100%; overflow:auto;"></div>
26+
<div id="tree-div" class="tree-wrapper"></div>
2727
</div>
2828
</div>
2929
<div data-id="information-dialog-tree" style="display: none;">

app/code/Magento/Persistent/Block/Header/Additional.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ protected function _toHtml()
7676
$this->customerRepository->getById($this->_persistentSessionHelper->getSession()->getCustomerId())
7777
)
7878
);
79-
return '<span><a ' . $this->getLinkAttributes() . ' >' . __('(Not %1?)', $persistentName)
79+
return '<span><a ' . $this->getLinkAttributes() . ' >' . __('Not you?')
8080
. '</a></span>';
8181
}
8282

app/code/Magento/Search/view/frontend/templates/form.mini.phtml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ $helper = $this->helper('Magento\Search\Helper\Data');
3030
placeholder="<?php echo __('Search entire store here...'); ?>"
3131
class="input-text"
3232
maxlength="<?php echo $helper->getMaxQueryLength();?>"
33+
role="combobox"
34+
aria-haspopup="false"
35+
aria-autocomplete="both"
3336
autocomplete="off"/>
3437
<div id="search_autocomplete" class="search-autocomplete"></div>
3538
<?php echo $this->getChildHtml() ?>

app/code/Magento/Search/view/frontend/web/form-mini.js

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ define([
3030
minSearchLength: 2,
3131
responseFieldElements: 'ul li',
3232
selectClass: 'selected',
33-
template: '<li class="{{row_class}}" title="{{title}}">{{title}}<span class="amount">{{num_of_results}}</span></li>',
33+
template: '<li class="{{row_class}}" id="qs-option-{{index}}" role="option"><span class="qs-option-name">{{title}}</span><span aria-hidden="true" class="amount">{{num_of_results}}</span></li>',
3434
submitBtn: 'button[type="submit"]',
3535
searchLabel: '[data-role=minisearch-label]'
3636
},
@@ -55,6 +55,7 @@ define([
5555
this.searchLabel.removeClass('active');
5656
}
5757
this.autoComplete.hide();
58+
this._updateAriaHasPopup(false);
5859
}, this), 250);
5960
}, this));
6061

@@ -66,7 +67,10 @@ define([
6667
this.element.on('keydown', this._onKeyDown);
6768
this.element.on('input propertychange', this._onPropertyChange);
6869

69-
this.searchForm.on('submit', this._onSubmit);
70+
this.searchForm.on('submit', $.proxy(function() {
71+
this._onSubmit();
72+
this._updateAriaHasPopup(false);
73+
}, this));
7074
},
7175
/**
7276
* @private
@@ -84,6 +88,18 @@ define([
8488
return this.responseList.indexList ? this.responseList.indexList.last() : false;
8589
},
8690

91+
/**
92+
* @private
93+
* @param {Boolean} show Set attribute aria-haspopup to "true/false" for element.
94+
*/
95+
_updateAriaHasPopup: function(show) {
96+
if (show) {
97+
this.element.attr('aria-haspopup', 'true');
98+
} else {
99+
this.element.attr('aria-haspopup', 'false');
100+
}
101+
},
102+
87103
/**
88104
* Clears the item selected from the suggestion list and resets the suggestion list.
89105
* @private
@@ -108,9 +124,9 @@ define([
108124
if (isEmpty(value)) {
109125
e.preventDefault();
110126
}
111-
127+
112128
if (this.responseList.selected) {
113-
this.element.val(this.responseList.selected.attr('title'));
129+
this.element.val(this.responseList.selected.find('.qs-option-name').text());
114130
}
115131
},
116132

@@ -153,6 +169,8 @@ define([
153169
this._getFirstVisibleElement().addClass(this.options.selectClass);
154170
this.responseList.selected = this._getFirstVisibleElement();
155171
}
172+
this.element.val(this.responseList.selected.find('.qs-option-name').text());
173+
this.element.attr('aria-activedescendant', this.responseList.selected.attr('id'));
156174
}
157175
break;
158176
case $.ui.keyCode.UP:
@@ -165,6 +183,8 @@ define([
165183
this._getLastElement().addClass(this.options.selectClass);
166184
this.responseList.selected = this._getLastElement();
167185
}
186+
this.element.val(this.responseList.selected.find('.qs-option-name').text());
187+
this.element.attr('aria-activedescendant', this.responseList.selected.attr('id'));
168188
}
169189
break;
170190
default:
@@ -189,14 +209,15 @@ define([
189209
},
190210
source = this.options.template,
191211
template = Handlebars.compile(source),
192-
dropdown = $('<ul></ul>'),
212+
dropdown = $('<ul role="listbox"></ul>'),
193213
value = this.element.val();
194214

195215
this.submitBtn.disabled = isEmpty(value);
196216

197217
if (value.length >= parseInt(this.options.minSearchLength, 10)) {
198218
$.get(this.options.url, {q: value}, $.proxy(function (data) {
199-
$.each(data, function(index, element){
219+
$.each(data, function(index, element) {
220+
element.index = index;
200221
var html = template(element);
201222
dropdown.append(html);
202223
});
@@ -206,7 +227,14 @@ define([
206227
.find(this.options.responseFieldElements + ':visible');
207228

208229
this._resetResponseList(false);
209-
230+
this.element.removeAttr('aria-activedescendant');
231+
232+
if (this.responseList.indexList.length) {
233+
this._updateAriaHasPopup(true);
234+
} else {
235+
this._updateAriaHasPopup(false);
236+
}
237+
210238
this.responseList.indexList
211239
.on('click', function (e) {
212240
this.responseList.selected = $(e.target);
@@ -216,6 +244,7 @@ define([
216244
this.responseList.indexList.removeClass(this.options.selectClass);
217245
$(e.target).addClass(this.options.selectClass);
218246
this.responseList.selected = $(e.target);
247+
this.element.attr('aria-activedescendant', $(e.target).attr('id'));
219248
}.bind(this))
220249
.on('mouseout', function (e) {
221250
if (!this._getLastElement() && this._getLastElement().hasClass(this.options.selectClass)) {
@@ -227,6 +256,8 @@ define([
227256
} else {
228257
this._resetResponseList(true);
229258
this.autoComplete.hide();
259+
this._updateAriaHasPopup(false);
260+
this.element.removeAttr('aria-activedescendant');
230261
}
231262
}
232263
});

app/code/Magento/Theme/view/frontend/layout/default.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<block class="Magento\Framework\View\Element\Template" name="skip_to_content" template="Magento_Theme::html/skip.phtml">
3636
<arguments>
3737
<argument name="target" xsi:type="string">contentarea</argument>
38-
<argument name="label" translate="true" xsi:type="string">Skip to content</argument>
38+
<argument name="label" translate="true" xsi:type="string">Skip to Content</argument>
3939
</arguments>
4040
</block>
4141
<block class="Magento\Store\Block\Switcher" name="store_language" as="store_language" template="switch/languages.phtml"/>

app/design/adminhtml/Magento/backend/web/css/admin.less

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,10 +1406,6 @@ address {
14061406
background-image: url(../images/fam_application_form_delete.png);
14071407
}
14081408

1409-
.x-tree-node {
1410-
overflow: auto;
1411-
}
1412-
14131409
/*
14141410
Styles for "js" tooltip with positionings
14151411
-------------------------------------- */
@@ -2815,6 +2811,12 @@ address {
28152811
padding: 0;
28162812
}
28172813

2814+
.tree-wrapper {
2815+
width: 100%;
2816+
overflow: auto;
2817+
float: left; // Fixed Chrome scroll issue
2818+
}
2819+
28182820
.page-actions.fixed .page-actions-inner:before {
28192821
content: attr(data-title);
28202822
float: left;

app/design/adminhtml/Magento/backend/web/less/styles/debug.less

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,16 @@
603603
line-height: 28px;
604604
}
605605

606+
.rule-tree .fieldset {
607+
min-width: 0; // Fixed Chrome fieldset issue
608+
}
609+
610+
@-moz-document url-prefix() { // Fixed Firefox fieldset issue
611+
.rule-tree .fieldset {
612+
display: table-cell;
613+
}
614+
}
615+
606616
.rule-tree ul {
607617
list-style: none;
608618
padding-left: 16px;
@@ -676,6 +686,7 @@
676686
border: solid 1px #CCC;
677687
margin: 20px;
678688
padding: 15px 10px 5px;
689+
overflow: auto;
679690
}
680691

681692
.rule-param-wait {

app/design/frontend/Magento/blank/Magento_Theme/web/css/source/module.less

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,20 @@ body {
8282
}
8383

8484
.action.skip {
85-
&:extend(.abs-visually-hidden all);
85+
&:not(:focus) {
86+
&:extend(.abs-visually-hidden all);
87+
}
88+
&:focus {
89+
position: absolute;
90+
z-index: 15;
91+
box-sizing: border-box;
92+
width: 100%;
93+
left: 0;
94+
top: 0;
95+
text-align: center;
96+
.css(background, @color-gray94);
97+
.css(padding, @indent-s-base);
98+
}
8699
}
87100

88101
//
@@ -248,6 +261,11 @@ body {
248261
a {
249262
line-height: 1.4;
250263
}
264+
&.welcome {
265+
a {
266+
.css(padding-left, @indent-xs-base);
267+
}
268+
}
251269
}
252270
margin-left: auto;
253271
}

app/design/frontend/Magento/blank/web/css/print.less

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
* See COPYING.txt for license details.
44
*/
55

6+
// Import vars
7+
@import "source/lib/lib.less"; // Import all lib files
8+
@import "source/theme.less"; // import theme styles
9+
10+
@baseDir: "../"; //default
11+
612
// Magento/blank
713
.page-print {
814
.logo {
@@ -12,7 +18,8 @@
1218
}
1319
}
1420
@media print {
15-
*{background: transparent !important;
21+
* {
22+
background: transparent !important;
1623
color: black !important;
1724
text-shadow: none !important;
1825
-webkit-filter: none !important; // Use in 41 Chrome

app/design/frontend/Magento/luma/Magento_Theme/web/css/source/module.less

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,21 @@
153153
}
154154
}
155155

156-
.action.skip:extend(.abs-visually-hidden all) {
156+
.action.skip {
157+
&:not(:focus) {
158+
&:extend(.abs-visually-hidden all);
159+
}
160+
&:focus {
161+
position: absolute;
162+
z-index: 15;
163+
box-sizing: border-box;
164+
width: 100%;
165+
left: 0;
166+
top: 0;
167+
text-align: center;
168+
.css(background, @color-gray94);
169+
.css(padding, @indent-s-base);
170+
}
157171
}
158172

159173
//
@@ -489,6 +503,12 @@
489503
display: inline-block;
490504
line-height: 1.4;
491505
}
506+
&.welcome {
507+
a {
508+
.css(color, @color-white);
509+
.css(padding-left, @indent-xs-base);
510+
}
511+
}
492512
}
493513
> .authorization-link:after {
494514
content: 'or';

0 commit comments

Comments
 (0)