Skip to content
Snippets Groups Projects
Commit 5e0bb4ad authored by Oleksii Korshenko's avatar Oleksii Korshenko Committed by GitHub
Browse files

MAGETWO-85297: 8410: Custom Checkout Step and Shipping Step are Highlighted...

MAGETWO-85297: 8410: Custom Checkout Step and Shipping Step are Highlighted and Combined upon Checkout page load #975
parents 558c8e84 c1eb8062
No related merge requests found
......@@ -66,7 +66,7 @@ define([
* @param {*} sortOrder
*/
registerStep: function (code, alias, title, isVisible, navigate, sortOrder) {
var hash;
var hash, active;
if ($.inArray(code, this.validCodes) !== -1) {
throw new DOMException('Step code [' + code + '] already registered in step navigator');
......@@ -87,6 +87,12 @@ define([
navigate: navigate,
sortOrder: sortOrder
});
active = this.getActiveItemIndex();
steps.each(function (elem, index) {
if (active !== index) {
elem.isVisible(false);
}
});
this.stepCodes.push(code);
hash = window.location.hash.replace('#', '');
......@@ -111,10 +117,14 @@ define([
getActiveItemIndex: function () {
var activeIndex = 0;
steps.sort(this.sortItems).forEach(function (element, index) {
steps.sort(this.sortItems).some(function (element, index) {
if (element.isVisible()) {
activeIndex = index;
return true;
}
return false;
});
return activeIndex;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment