Skip to content

Commit

Permalink
Update navigator-mixin.js
Browse files Browse the repository at this point in the history
steps is an observable knockout array; and knockout did some change on it behaviour 
function to return the `observableArray` instead of the `Array` (knockout/knockout#1380)

https://github.com/magento/magento2/blob/0eb8677b0b4e35606032e856cc1ef7c80e68829f/app/code/Magento/Checkout/view/frontend/web/js/model/step-navigator.js#L15

This pull request modify calling variable steps.

due to the core change in Magento_Checkout :
216b595d69f601019779ca57e446d7c904f89175
  • Loading branch information
Ilan Parmentier authored Feb 12, 2019
1 parent b89dff6 commit 4be2e94
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/view/frontend/web/js/mixin/navigator-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ define([
if (customer.isLoggedIn() && code === 'email') {
return;
}
var sortedItems = target.steps.sort(this.sortItems);
var sortedItems = target.steps().sort(this.sortItems);
if (!this.isProcessed(code)) {
return;
}

window.location = window.checkoutConfig.checkoutUrl + '#' + code;
sortedItems.forEach(function (element) {
element.isVisible(element.code === code);
element.isVisible(element.code == code); //eslint-disable-line eqeqeq
});
};

Expand All @@ -50,7 +50,7 @@ define([
return false;
}

isRequestedStepVisible = target.steps.sort(this.sortItems).some(function (element) {
isRequestedStepVisible = target.steps().sort(this.sortItems).some(function (element) {
return (element.code == hashString || element.alias == hashString) && element.isVisible(); //eslint-disable-line
});

Expand All @@ -59,7 +59,7 @@ define([
return false;
}

target.steps.sort(this.sortItems).forEach(function (element) {
target.steps().sort(this.sortItems).forEach(function (element) {
if (element.code == hashString || element.alias == hashString) { //eslint-disable-line eqeqeq
element.navigate(element);
} else {
Expand All @@ -73,4 +73,4 @@ define([

return target;
};
});
});

0 comments on commit 4be2e94

Please sign in to comment.