Skip to content

Commit 8b5026a

Browse files
author
Kopylova,Olga(okopylova)
committed
Merge pull request #419 from magento-vanilla/PR
[Vanilla] Bugsfixes
2 parents a09b7a1 + 7e0e89d commit 8b5026a

File tree

6 files changed

+38
-29
lines changed

6 files changed

+38
-29
lines changed

app/code/Magento/Checkout/view/frontend/web/js/sidebar.js

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,41 +24,41 @@ define([
2424
},
2525

2626
_initContent: function() {
27-
var self = this;
27+
var self = this,
28+
events = {};
2829

2930
this.element.decorate('list', this.options.isRecursive);
3031

31-
$(this.options.button.close).click(function(event) {
32+
events['click ' + this.options.button.close] = function(event) {
3233
event.stopPropagation();
3334
$(self.options.targetElement).dropdownDialog("close");
34-
});
35-
36-
$(this.options.button.checkout).on('click', $.proxy(function() {
35+
};
36+
events['click ' + this.options.button.checkout] = $.proxy(function() {
3737
var cart = customerData.get('cart'),
3838
customer = customerData.get('customer');
3939

4040
if (customer() == false && !cart().isGuestCheckoutAllowed) {
4141
authenticationPopup.showModal();
42+
4243
return false;
4344
}
4445
location.href = this.options.url.checkout;
45-
}, this));
46-
47-
$(this.options.button.remove).click(function(event) {
46+
}, this);
47+
events['click ' + this.options.button.remove] = function(event) {
4848
event.stopPropagation();
4949
if (confirm(self.options.confirmMessage)) {
50-
self._removeItem($(this));
50+
self._removeItem($(event.target));
5151
}
52-
});
53-
54-
$(this.options.item.qty).keyup(function() {
55-
self._showItemButton($(this));
56-
});
57-
$(this.options.item.button).click(function(event) {
52+
};
53+
events['keyup ' + this.options.item.qty] = function(event) {
54+
self._showItemButton($(event.target));
55+
};
56+
events['click ' + this.options.item.button] = function(event) {
5857
event.stopPropagation();
59-
self._updateItemQty($(this))
60-
});
58+
self._updateItemQty($(event.target));
59+
};
6160

61+
this._on(this.element, events);
6262
this._calcHeight();
6363
this._isOverflowed();
6464
},
@@ -122,10 +122,8 @@ define([
122122
* Update content after update qty
123123
*
124124
* @param elem
125-
* @param response
126-
* @private
127125
*/
128-
_updateItemQtyAfter: function(elem, response) {
126+
_updateItemQtyAfter: function(elem) {
129127
this._hideItemButton(elem);
130128
},
131129

app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,24 @@ define([
77
'Magento_Customer/js/customer-data',
88
'jquery',
99
'ko',
10-
'mage/url'
10+
'mage/url',
11+
'sidebar'
1112
], function (Component, customerData, $, ko, url) {
1213
'use strict';
1314

1415
var sidebarInitialized = false;
16+
1517
url.setBaseUrl(window.checkout.baseUrl);
1618

1719
function initSidebar() {
1820
var minicart = $("[data-block='minicart']");
21+
1922
minicart.trigger('contentUpdated');
2023
if (sidebarInitialized) {
2124
return false;
2225
}
2326
sidebarInitialized = true;
24-
minicart.mage('sidebar', {
27+
minicart.sidebar({
2528
"targetElement": "div.block.block-minicart",
2629
"url": {
2730
"checkout": window.checkout.checkoutUrl,
@@ -64,12 +67,14 @@ define([
6467
});
6568
},
6669
initSidebar: ko.observable(initSidebar),
67-
closeSidebar: function(element) {
70+
closeSidebar: function() {
6871
var minicart = $('[data-block="minicart"]');
72+
6973
minicart.on('click', '[data-action="close"]', function(event) {
7074
event.stopPropagation();
7175
minicart.find('[data-role="dropdownDialog"]').dropdownDialog("close");
7276
});
77+
7378
return true;
7479
},
7580
getItemRenderer: function (productType) {

app/code/Magento/Cookie/View/frontend/templates/html/notices.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"cookieNotices": {
2929
"cookieAllowButtonSelector": "#btn-cookie-allow",
3030
"cookieName": "<?php echo \Magento\Cookie\Helper\Cookie::IS_USER_ALLOWED_SAVE_COOKIE ?>",
31-
"cookieValue": "<?php echo $this->helper('Magento\Cookie\Helper\Cookie')->getAcceptedSaveCookiesWebsiteIds() ?>",
31+
"cookieValue": <?php echo $this->helper('Magento\Cookie\Helper\Cookie')->getAcceptedSaveCookiesWebsiteIds() ?>,
3232
"cookieLifetime": <?php echo $this->helper('Magento\Cookie\Helper\Cookie')->getCookieRestrictionLifetime()?>,
3333
"noCookiesUrl": "<?php echo $block->getUrl('cookie/index/noCookies') ?>"
3434
}

app/code/Magento/Tax/Model/Calculation/Rate/Converter.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ public function createArrayFromServiceObject(
7474
'zip_is_range' => $returnNumericLogic?0:false,
7575
];
7676

77+
if ($taxRateFormData['tax_region_id'] === '0') {
78+
$taxRateFormData['tax_region_id'] = '';
79+
}
80+
7781
if ($taxRate->getZipFrom() && $taxRate->getZipTo()) {
7882
$taxRateFormData['zip_is_range'] = $returnNumericLogic?1:true;
7983
$taxRateFormData['zip_from'] = $taxRate->getZipFrom();

app/code/Magento/Theme/view/adminhtml/requirejs-config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ var config = {
1111
"extjs/ext-tree-checkbox": [
1212
"extjs/ext-tree",
1313
"extjs/defaults"
14+
],
15+
"jquery/editableMultiselect/js/jquery.editable": [
16+
"jquery"
1417
]
1518
},
1619
"bundles": {

lib/web/mage/apply/main.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ define([
6767
.map(getData)
6868
.concat(virtuals)
6969
.forEach(function (itemContainer) {
70-
var configStack,
71-
element = itemContainer.el;
70+
var element = itemContainer.el;
7271

7372
_.each(itemContainer.data, function (obj, key) {
7473
if (obj.mixins) {
@@ -78,10 +77,10 @@ define([
7877
}
7978

8079
delete obj.mixins;
81-
_.each(itemContainer.data, init.bind(null, element));
82-
})
80+
init.call(null, element, obj, key);
81+
});
8382
} else {
84-
_.each(itemContainer.data, init.bind(null, element));
83+
init.call(null, element, obj, key);
8584
}
8685

8786
}

0 commit comments

Comments
 (0)