clu3/bootstro.js — pull request #24 by tsrivishnu (2013-06-08 11:52:03+00:00)
Title: Issue causing the tour to break when a particular step is missing addressed

Hello.,

Here is my suggested solution for issue #5

As I understood the issue is being caused since you were incrementing the index value when the user tries to go to the next popup.
What i have done is, I have taken all the steps indexes for the DOM into an array,

indexes = $elements.map(function(){ return parseInt($(this).attr('data-bootstro-step')) })

and if all the DOM elements are not provided with step, make the order default to follow DOM ordering

defaultOrder = $.grep(indexes, function(x){ return !(isNaN(x)) }).length == 0 ? true : false

So when ever the user tries to go for the next popup, I check over the indexes array to find if the index we are trying is existing, if not, trying for the next available index

nextIndex = function(indexToTry){
closestIndex = null
// loop and find the next available value less than or equal to the indexToTry
$.each(indexes, function(){
if (parseInt(this) >= parseInt(indexToTry)) {
closestIndex = this;
return false;
}
});
return closestIndex;
}

so it always will find the next available popup and go in a order rather than jumping around when a step is missing.