|
633 | 633 | var wizard = $(this),
|
634 | 634 | options = wizard.data("options"),
|
635 | 635 | state = wizard.data("state"),
|
636 |
| - currentStep = $(".steps li:eq(" + state.currentIndex + ")", wizard); |
| 636 | + currentStep = $("li[role=tab]:eq(" + state.currentIndex + ")", wizard); |
637 | 637 |
|
638 | 638 | if (wizard.triggerHandler("finishing", [state.currentIndex]))
|
639 | 639 | {
|
|
668 | 668 | var contentContainer = wizard.children(".content");
|
669 | 669 | $(".title:eq(" + index + ")", contentContainer).remove();
|
670 | 670 | $(".body:eq(" + index + ")", contentContainer).remove();
|
671 |
| - $(".steps > ol > li:eq(" + index + ")", wizard).remove(); |
| 671 | + $("li[role=tab]:eq(" + index + ")", wizard).remove(); |
672 | 672 |
|
673 | 673 | // Reset state values
|
674 | 674 | if (state.currentIndex > index)
|
|
682 | 682 | // Set the "first" class to the new first step button
|
683 | 683 | if (index === 0)
|
684 | 684 | {
|
685 |
| - $(".steps > ol > li:first", wizard).addClass("first"); |
| 685 | + $("li[role=tab]:first", wizard).addClass("first"); |
686 | 686 | }
|
687 | 687 |
|
688 | 688 | // Set the "last" class to the new last step button
|
689 | 689 | if (index === state.stepCount)
|
690 | 690 | {
|
691 |
| - $(".steps > ol > li:eq(" + index + ")", wizard).addClass("last"); |
| 691 | + $("li[role=tab]:eq(" + index + ")", wizard).addClass("last"); |
692 | 692 | }
|
693 | 693 |
|
694 | 694 | updateSteps(wizard, index);
|
|
769 | 769 | state.currentStep = getStepProperties(wizard, state.currentIndex);
|
770 | 770 |
|
771 | 771 | // Add click event
|
772 |
| - $(".steps > ol > li:eq(" + index + ") > a", wizard).bind("click.steps", stepClickHandler); |
| 772 | + $("li[role=tab]:eq(" + index + ") > a", wizard).bind("click.steps", stepClickHandler); |
773 | 773 |
|
774 | 774 | updateSteps(wizard, index);
|
775 | 775 | refreshActionState(wizard);
|
|
810 | 810 |
|
811 | 811 | if (opts.autoFocus && _uniqueId === 1)
|
812 | 812 | {
|
813 |
| - $(".steps li.current a", $this).focus(); |
| 813 | + $("li[role=tab].current a", $this).focus(); |
814 | 814 | }
|
815 | 815 |
|
816 | 816 | $this.bind("finishing.steps", opts.onFinishing);
|
|
1025 | 1025 | stepContents.eq(startIndex).show().attr("aria-hidden", "false");
|
1026 | 1026 |
|
1027 | 1027 | var stepsWrapper = $(document.createElement(options.stepsContainerTag))
|
1028 |
| - .addClass("steps").append($("<ol role=\"tablist\"></ol>")); |
| 1028 | + .addClass("steps").append($("<ul role=\"tablist\"></ul>")); |
1029 | 1029 | wizard.prepend(stepsWrapper);
|
1030 | 1030 |
|
1031 | 1031 | stepTitles.each(function (index)
|
|
1034 | 1034 |
|
1035 | 1035 | if (index < startIndex)
|
1036 | 1036 | {
|
1037 |
| - $(".steps > ol > li:eq(" + index + ")", wizard).addClass("done"); |
| 1037 | + $("li[role=tab]:eq(" + index + ")", wizard).addClass("done"); |
1038 | 1038 | }
|
1039 | 1039 |
|
1040 | 1040 | if (index > startIndex && !options.enableAllSteps)
|
1041 | 1041 | {
|
1042 |
| - $(".steps > ol > li:eq(" + index + ")", wizard).addClass("disabled") |
| 1042 | + $("li[role=tab]:eq(" + index + ")", wizard).addClass("disabled") |
1043 | 1043 | .attr("aria-disabled", "true");
|
1044 | 1044 | }
|
1045 | 1045 | });
|
|
1109 | 1109 | uniqueHeaderId = uniqueId + "-header-" + index,
|
1110 | 1110 | options = wizard.data("options"),
|
1111 | 1111 | state = wizard.data("state"),
|
1112 |
| - stepCollection = $(".steps > ol", wizard), |
| 1112 | + stepCollection = $(".steps > ul", wizard), |
1113 | 1113 | title = renderTemplate(options.titleTemplate, {
|
1114 | 1114 | index: index + 1,
|
1115 | 1115 | title: header.html()
|
|
1197 | 1197 | uniqueBodyId = uniqueId + "-tabpanel-" + i,
|
1198 | 1198 | uniqueHeaderId = uniqueId + "-header-" + i,
|
1199 | 1199 | title = $(".content > .title:eq(" + i + ")", wizard).attr("id", uniqueHeaderId);
|
1200 |
| - $(".steps > ol > li:eq(" + i + ") > a", wizard).attr("id", uniqueStepId) |
| 1200 | + $("li[role=tab]:eq(" + i + ") > a", wizard).attr("id", uniqueStepId) |
1201 | 1201 | .attr("aria-controls", uniqueBodyId).attr("href", "#" + uniqueHeaderId)
|
1202 | 1202 | .html(renderTemplate(options.titleTemplate, { index: i + 1, title: title.html() }));
|
1203 | 1203 | $(".content > .body:eq(" + i + ")", wizard).attr("id", uniqueBodyId)
|
|
1225 | 1225 |
|
1226 | 1226 | if (oldIndex != null)
|
1227 | 1227 | {
|
1228 |
| - var oldStep = steps.eq(oldIndex).addClass("done").removeClass("current error"); |
| 1228 | + var oldStep = steps.eq(oldIndex).addClass("done").removeClass("current error").attr("aria-selected", "false"); |
1229 | 1229 | stepTitles.eq(oldIndex).removeClass("current").next(".body").removeClass("current");
|
1230 | 1230 | currentInfo = $("a > .current-info", oldStep);
|
1231 | 1231 | currentOrNewStep.children("a").focus();
|
1232 | 1232 | }
|
1233 | 1233 |
|
1234 |
| - currentOrNewStep.addClass("current").removeClass("disabled done") |
| 1234 | + currentOrNewStep.addClass("current").attr("aria-selected", "true").removeClass("disabled done") |
1235 | 1235 | .attr("aria-disabled", "false").children("a").prepend(currentInfo);
|
1236 | 1236 | stepTitles.eq(index).addClass("current").next(".body").addClass("current");
|
1237 | 1237 | }
|
|
0 commit comments