Skip to content

Commit 3bcc1c9

Browse files
author
Yaroslav Onischenko
authored
Merge pull request #281 from magento-frontend/pub-pr
[Frontend] Public PRs
2 parents 1b30452 + f727054 commit 3bcc1c9

File tree

7 files changed

+159
-98
lines changed

7 files changed

+159
-98
lines changed

app/code/Magento/Catalog/view/frontend/templates/product/view/form.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<script>
4141
require([
4242
'jquery',
43-
'Magento_Catalog/js/price-box'
43+
'priceBox'
4444
], function($){
4545
var priceBoxes = $('[data-role=priceBox]');
4646

app/code/Magento/Ui/view/base/web/js/grid/filters/range.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ define([
66
'underscore',
77
'uiLayout',
88
'mageUtils',
9-
'Magento_Ui/js/form/components/group'
10-
], function (_, layout, utils, Group) {
9+
'Magento_Ui/js/form/components/group',
10+
'mage/translate'
11+
], function (_, layout, utils, Group, $t) {
1112
'use strict';
1213

1314
return Group.extend({
@@ -29,11 +30,11 @@ define([
2930
},
3031
ranges: {
3132
from: {
32-
label: 'from',
33+
label: $t('from'),
3334
dataScope: 'from'
3435
},
3536
to: {
36-
label: 'to',
37+
label: $t('to'),
3738
dataScope: 'to'
3839
}
3940
}

lib/internal/Magento/Framework/View/Element/Template.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public function __construct(Template\Context $context, array $data = [])
139139
}
140140

141141
/**
142-
* Set template context. Sets the object that should represent $this in template
142+
* Set template context. Sets the object that should represent $block in template
143143
*
144144
* @param \Magento\Framework\View\Element\BlockInterface $templateContext
145145
* @return void

lib/web/mage/backend/validation.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@
224224
}
225225
return true;
226226
},
227-
'Please enter a number greater 0 in this field.'
227+
$.mage.__('Please enter a number greater 0 in this field.')
228228
],
229229
'validate-rating': [
230230
function () {
@@ -236,7 +236,7 @@
236236
});
237237
return noError;
238238
},
239-
'Please select one of each ratings above.'
239+
$.mage.__('Please select one of each ratings above.')
240240
],
241241
'validate-downloadable-file': [
242242
function (v, element) {
@@ -267,7 +267,7 @@
267267
}
268268
return true;
269269
},
270-
'Please specify Url.'
270+
$.mage.__('Please specify Url.')
271271
]
272272
}, function (rule, i) {
273273
rule.unshift(i);

lib/web/mage/menu.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,9 @@ define([
275275
if (!target.hasClass('level-top') || !target.has(".ui-menu").length) {
276276
window.location.href = target.find('> a').attr('href');
277277
}
278+
},
279+
"click .ui-menu-item:has(.ui-state-active)": function (event) {
280+
this.collapseAll(event, true);
278281
}
279282
});
280283

@@ -390,6 +393,39 @@ define([
390393
};
391394

392395
return setTimeout(handlerProxy, delay || 0);
396+
},
397+
expand: function( event ) {
398+
var newItem = this.active &&
399+
this.active
400+
.children( ".ui-menu " )
401+
.children( ".ui-menu-item" )
402+
.first();
403+
404+
if ( newItem && newItem.length ) {
405+
if (newItem.closest( ".ui-menu" ).is( ":visible" )
406+
&& newItem.closest( ".ui-menu" ).has( ".all-categories" )
407+
) {
408+
return;
409+
}
410+
411+
this._open( newItem.parent() );
412+
413+
// Delay so Firefox will not hide activedescendant change in expanding submenu from AT
414+
this._delay(function() {
415+
this.focus( event, newItem );
416+
});
417+
}
418+
},
419+
select: function( event ) {
420+
this.active = this.active || $( event.target ).closest( ".ui-menu-item" );
421+
if (this.active.is( ".all-category" )) {
422+
this.active = $( event.target ).closest( ".ui-menu-item" );
423+
}
424+
var ui = { item: this.active };
425+
if ( !this.active.has( ".ui-menu" ).length ) {
426+
this.collapseAll( event, true );
427+
}
428+
this._trigger( "select", event, ui );
393429
}
394430
});
395431

0 commit comments

Comments
 (0)