Skip to content

Commit

Permalink
Merge pull request #419 from magento-vanilla/PR
Browse files Browse the repository at this point in the history
[Vanilla] Bugsfixes
  • Loading branch information
Kopylova,Olga(okopylova) committed Jul 6, 2015
2 parents a09b7a1 + 7e0e89d commit 8b5026a
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 29 deletions.
38 changes: 18 additions & 20 deletions app/code/Magento/Checkout/view/frontend/web/js/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
},
Expand Down Expand Up @@ -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);
},

Expand Down
11 changes: 8 additions & 3 deletions app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"cookieNotices": {
"cookieAllowButtonSelector": "#btn-cookie-allow",
"cookieName": "<?php echo \Magento\Cookie\Helper\Cookie::IS_USER_ALLOWED_SAVE_COOKIE ?>",
"cookieValue": "<?php echo $this->helper('Magento\Cookie\Helper\Cookie')->getAcceptedSaveCookiesWebsiteIds() ?>",
"cookieValue": <?php echo $this->helper('Magento\Cookie\Helper\Cookie')->getAcceptedSaveCookiesWebsiteIds() ?>,
"cookieLifetime": <?php echo $this->helper('Magento\Cookie\Helper\Cookie')->getCookieRestrictionLifetime()?>,
"noCookiesUrl": "<?php echo $block->getUrl('cookie/index/noCookies') ?>"
}
Expand Down
4 changes: 4 additions & 0 deletions app/code/Magento/Tax/Model/Calculation/Rate/Converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 3 additions & 0 deletions app/code/Magento/Theme/view/adminhtml/requirejs-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ var config = {
"extjs/ext-tree-checkbox": [
"extjs/ext-tree",
"extjs/defaults"
],
"jquery/editableMultiselect/js/jquery.editable": [
"jquery"
]
},
"bundles": {
Expand Down
9 changes: 4 additions & 5 deletions lib/web/mage/apply/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
}

}
Expand Down

0 comments on commit 8b5026a

Please sign in to comment.