diff --git a/app/code/Magento/Checkout/view/frontend/web/js/sidebar.js b/app/code/Magento/Checkout/view/frontend/web/js/sidebar.js index 5f93022da11a9..a7242d44933b7 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/sidebar.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/sidebar.js @@ -24,41 +24,41 @@ define([ }, _initContent: function() { - var self = this; + var self = this, + events = {}; this.element.decorate('list', this.options.isRecursive); - $(this.options.button.close).click(function(event) { + events['click ' + this.options.button.close] = function(event) { event.stopPropagation(); $(self.options.targetElement).dropdownDialog("close"); - }); - - $(this.options.button.checkout).on('click', $.proxy(function() { + }; + events['click ' + this.options.button.checkout] = $.proxy(function() { var cart = customerData.get('cart'), customer = customerData.get('customer'); if (customer() == false && !cart().isGuestCheckoutAllowed) { authenticationPopup.showModal(); + return false; } location.href = this.options.url.checkout; - }, this)); - - $(this.options.button.remove).click(function(event) { + }, this); + events['click ' + this.options.button.remove] = function(event) { event.stopPropagation(); if (confirm(self.options.confirmMessage)) { - self._removeItem($(this)); + self._removeItem($(event.target)); } - }); - - $(this.options.item.qty).keyup(function() { - self._showItemButton($(this)); - }); - $(this.options.item.button).click(function(event) { + }; + events['keyup ' + this.options.item.qty] = function(event) { + self._showItemButton($(event.target)); + }; + events['click ' + this.options.item.button] = function(event) { event.stopPropagation(); - self._updateItemQty($(this)) - }); + self._updateItemQty($(event.target)); + }; + this._on(this.element, events); this._calcHeight(); this._isOverflowed(); }, @@ -122,10 +122,8 @@ define([ * Update content after update qty * * @param elem - * @param response - * @private */ - _updateItemQtyAfter: function(elem, response) { + _updateItemQtyAfter: function(elem) { this._hideItemButton(elem); }, diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js b/app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js index 51e59d8ff6bb3..e1c2e3c57c220 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js @@ -7,21 +7,24 @@ define([ 'Magento_Customer/js/customer-data', 'jquery', 'ko', - 'mage/url' + 'mage/url', + 'sidebar' ], function (Component, customerData, $, ko, url) { 'use strict'; var sidebarInitialized = false; + url.setBaseUrl(window.checkout.baseUrl); function initSidebar() { var minicart = $("[data-block='minicart']"); + minicart.trigger('contentUpdated'); if (sidebarInitialized) { return false; } sidebarInitialized = true; - minicart.mage('sidebar', { + minicart.sidebar({ "targetElement": "div.block.block-minicart", "url": { "checkout": window.checkout.checkoutUrl, @@ -64,12 +67,14 @@ define([ }); }, initSidebar: ko.observable(initSidebar), - closeSidebar: function(element) { + closeSidebar: function() { var minicart = $('[data-block="minicart"]'); + minicart.on('click', '[data-action="close"]', function(event) { event.stopPropagation(); minicart.find('[data-role="dropdownDialog"]').dropdownDialog("close"); }); + return true; }, getItemRenderer: function (productType) { diff --git a/app/code/Magento/Cookie/View/frontend/templates/html/notices.phtml b/app/code/Magento/Cookie/View/frontend/templates/html/notices.phtml index ded203df87220..e22d0fa8f092f 100644 --- a/app/code/Magento/Cookie/View/frontend/templates/html/notices.phtml +++ b/app/code/Magento/Cookie/View/frontend/templates/html/notices.phtml @@ -28,7 +28,7 @@ "cookieNotices": { "cookieAllowButtonSelector": "#btn-cookie-allow", "cookieName": "", - "cookieValue": "helper('Magento\Cookie\Helper\Cookie')->getAcceptedSaveCookiesWebsiteIds() ?>", + "cookieValue": helper('Magento\Cookie\Helper\Cookie')->getAcceptedSaveCookiesWebsiteIds() ?>, "cookieLifetime": helper('Magento\Cookie\Helper\Cookie')->getCookieRestrictionLifetime()?>, "noCookiesUrl": "getUrl('cookie/index/noCookies') ?>" } diff --git a/app/code/Magento/Tax/Model/Calculation/Rate/Converter.php b/app/code/Magento/Tax/Model/Calculation/Rate/Converter.php index 5fd8da907a5d8..b7dc4920d15cc 100644 --- a/app/code/Magento/Tax/Model/Calculation/Rate/Converter.php +++ b/app/code/Magento/Tax/Model/Calculation/Rate/Converter.php @@ -74,6 +74,10 @@ public function createArrayFromServiceObject( 'zip_is_range' => $returnNumericLogic?0:false, ]; + if ($taxRateFormData['tax_region_id'] === '0') { + $taxRateFormData['tax_region_id'] = ''; + } + if ($taxRate->getZipFrom() && $taxRate->getZipTo()) { $taxRateFormData['zip_is_range'] = $returnNumericLogic?1:true; $taxRateFormData['zip_from'] = $taxRate->getZipFrom(); diff --git a/app/code/Magento/Theme/view/adminhtml/requirejs-config.js b/app/code/Magento/Theme/view/adminhtml/requirejs-config.js index 0cc7098574c9d..81603bc35d901 100644 --- a/app/code/Magento/Theme/view/adminhtml/requirejs-config.js +++ b/app/code/Magento/Theme/view/adminhtml/requirejs-config.js @@ -11,6 +11,9 @@ var config = { "extjs/ext-tree-checkbox": [ "extjs/ext-tree", "extjs/defaults" + ], + "jquery/editableMultiselect/js/jquery.editable": [ + "jquery" ] }, "bundles": { diff --git a/lib/web/mage/apply/main.js b/lib/web/mage/apply/main.js index 37a12873c3335..55166b089fd6c 100644 --- a/lib/web/mage/apply/main.js +++ b/lib/web/mage/apply/main.js @@ -67,8 +67,7 @@ define([ .map(getData) .concat(virtuals) .forEach(function (itemContainer) { - var configStack, - element = itemContainer.el; + var element = itemContainer.el; _.each(itemContainer.data, function (obj, key) { if (obj.mixins) { @@ -78,10 +77,10 @@ define([ } delete obj.mixins; - _.each(itemContainer.data, init.bind(null, element)); - }) + init.call(null, element, obj, key); + }); } else { - _.each(itemContainer.data, init.bind(null, element)); + init.call(null, element, obj, key); } }