Skip to content

Commit eec8b33

Browse files
author
Rafael J. Staib
committed
Add fix for visualization bug (related to inserting and removing)
1 parent 8091c7a commit eec8b33

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

jquery.steps.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@
391391
state.stepCount = $(".body", contentContainer).length;
392392
state.currentStep = getStepProperties(wizard, state.currentIndex);
393393

394-
updateIdentifiers(wizard, index);
394+
updateSteps(wizard, index);
395395
refreshActionState(wizard);
396396

397397
return true;
@@ -475,7 +475,7 @@
475475
state.stepCount = contentContainer.children(".body").length;
476476
state.currentStep = getStepProperties(wizard, state.currentIndex);
477477

478-
updateIdentifiers(wizard, index);
478+
updateSteps(wizard, index);
479479
refreshActionState(wizard);
480480

481481
return wizard;
@@ -828,19 +828,22 @@
828828
}
829829

830830
/**
831-
* Updates identifiers for step buttons and their related titles.
831+
* Updates step buttons and their related titles.
832832
*
833833
* @private
834-
* @method updateIdentifiers
834+
* @method updateSteps
835835
* @param wizard {Object} A jQuery wizard object
836836
* @param index {Integer} The start point for updating ids
837837
*/
838-
function updateIdentifiers(wizard, index)
838+
function updateSteps(wizard, index)
839839
{
840+
var options = wizard.data("options");
841+
840842
for (var i = index; i < wizard.data("state").stepCount; i++)
841843
{
842-
$(".steps > ol > li:eq(" + i + ") > a", wizard).attr("href", "#" + getUniqueId(wizard) + "-" + i);
843-
$(".content > .title:eq(" + i + ")", wizard).attr("id", getUniqueId(wizard) + "-" + i);
844+
var title = $(".content > .title:eq(" + i + ")", wizard).attr("id", getUniqueId(wizard) + "-" + i);
845+
$(".steps > ol > li:eq(" + i + ") > a", wizard).attr("href", "#" + getUniqueId(wizard) + "-" + i)
846+
.html(renderTemplate(options.titleTemplate, { index: i + 1, title: title.html() }));
844847
}
845848
}
846849

0 commit comments

Comments
 (0)