VinceG / twitter-bootstrap-wizard

This twitter bootstrap plugin builds a wizard out of a formatter tabbable structure. It allows to build a wizard functionality using buttons to go through the different wizard steps and using events allows to hook into each step individually.
MIT License
1.39k stars 676 forks source link

$element and $index are not defined. #135

Closed ashleyredzko closed 8 years ago

ashleyredzko commented 9 years ago

I'm working with a team on a project that uses the wizard. We've created an override that listens for events fired by the wizard and can handle multiple bootstrap wizards based on data tag values on the elements. We've run into a problem where there are some variables referenced that are not defined. Namely, $element and $index.

We did not have an issue before our custom code, but we also cannot find where these values are created/pulled from, as they appear to be global variables not defined in the scope of the wizard. the problem lines (from jsHint) are:

Three undefined variables
72  $index
75  $index
78  $index
93  $index
95  $index
98  $index
232 $element
233 $element
236 $element
244 $element
331 jQuery // Ignoring this.

Which shows that $index is used in this.next() and this.previous(). $element is used in innerTabShown. When var is added to instantiate the variables inside of these functions, the wizard works as intended. Oddly, this.remove() actually defines $index as var $index = args[0];. It would be helpful to know if this is intended (and thus where these elements get pulled from) or if we should submit a pull request with our fix.

TL; DR: Where are $index and $element pulled from?