Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Steps - Skipping stages when I include JavaScript implementation #47
Browse files Browse the repository at this point in the history
  • Loading branch information
Wikiki committed May 31, 2018
1 parent b096899 commit 841c65a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 16 deletions.
24 changes: 17 additions & 7 deletions dist/bulma-steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,23 @@ class StepsWizard {
this.init();
}

/**
* Initiate all DOM element containing tagsinput class
* @method
* @return {Array} Array of all TagsInput instances
*/
static attach(selector = '.steps', options = {}) {
let stepsInstances = new Array();

const steps = document.querySelectorAll(selector);
[].forEach.call(steps, step => {
setTimeout(() => {
stepsInstances.push(new StepsWizard(step, options));
}, 100);
});
return stepsInstances;
}

init() {
for (var i = 0; i < this.steps.length; i++) {
var step = this.steps[i];
Expand Down Expand Up @@ -200,13 +217,6 @@ class StepsWizard {
}
}

document.addEventListener('DOMContentLoaded', function() {
var stepsContainers = document.querySelectorAll('.steps');
[].forEach.call(stepsContainers, (stepsContainer) => {
var stepsWizard = new StepsWizard(stepsContainer);
});
});

return StepsWizard;

}());
Loading

0 comments on commit 841c65a

Please sign in to comment.