Skip to content
Snippets Groups Projects
Commit c1eb8062 authored by Oleksandr Miroshnichenko's avatar Oleksandr Miroshnichenko
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

 - Merge Pull Request magento-engcom/magento2ce#975 from RomaKis/magento2:8410
 - Merged commits:
   1. fd5f40a9
   2. c12dc31b
   3. 04ff6611
   4. fccecf38
   5. f7289237
   6. a0b5460f
   7. 98e7951b
parents d865ef1e 98e7951b
Branches
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