|
20 | 20 | *
|
21 | 21 | * Planed Features:
|
22 | 22 | * - Progress bar
|
23 |
| - * - Advanced Accessibility support (WAI-ARIA) |
24 | 23 | * - Implement preloadContent for async and iframe content types.
|
25 | 24 | * - Implement functionality to skip a certain amount of steps
|
26 | 25 | * - Dynamic settings change (setOptions({ enablePagination: false }))
|
|
286 | 285 | * @type Boolean
|
287 | 286 | * @default false
|
288 | 287 | * @for defaults
|
| 288 | + * @since 0.9.4 |
289 | 289 | **/
|
290 | 290 | autoFocus: false,
|
291 | 291 |
|
|
766 | 766 | transformBody(wizard, body, index);
|
767 | 767 | transformTitle(wizard, header, index);
|
768 | 768 |
|
| 769 | + var currentStep = $("li[role=tab]:eq(" + index + ")", wizard); |
| 770 | + if (state.currentIndex > index) |
| 771 | + { |
| 772 | + currentStep.removeClass("disabled").attr("aria-disabled", "false").addClass("done"); |
| 773 | + } |
| 774 | + |
769 | 775 | state.currentStep = getStepProperties(wizard, state.currentIndex);
|
770 | 776 |
|
771 | 777 | // Add click event
|
772 |
| - $("li[role=tab]:eq(" + index + ") > a", wizard).bind("click.steps", stepClickHandler); |
| 778 | + currentStep.children("a").bind("click.steps", stepClickHandler); |
773 | 779 |
|
774 | 780 | updateSteps(wizard, index);
|
775 | 781 | refreshActionState(wizard);
|
|
1034 | 1040 |
|
1035 | 1041 | if (index < startIndex)
|
1036 | 1042 | {
|
1037 |
| - $("li[role=tab]:eq(" + index + ")", wizard).addClass("done"); |
1038 |
| - } |
1039 |
| - |
1040 |
| - if (index > startIndex && !options.enableAllSteps) |
1041 |
| - { |
1042 |
| - $("li[role=tab]:eq(" + index + ")", wizard).addClass("disabled") |
1043 |
| - .attr("aria-disabled", "true"); |
| 1043 | + $("li[role=tab]:eq(" + index + ")", wizard).removeClass("disabled").attr("aria-disabled", "false").addClass("done"); |
1044 | 1044 | }
|
1045 | 1045 | });
|
1046 | 1046 |
|
|
1116 | 1116 | }),
|
1117 | 1117 | stepItem = $("<li role=\"tab\"><a id=\"" + uniqueStepId + "\" href=\"#" + uniqueHeaderId +
|
1118 | 1118 | "\" aria-controls=\"" + uniqueBodyId + "\">" + title + "</a></li>");
|
| 1119 | + |
| 1120 | + if (!options.enableAllSteps) |
| 1121 | + { |
| 1122 | + stepItem.addClass("disabled").attr("aria-disabled", "true"); |
| 1123 | + } |
1119 | 1124 |
|
1120 | 1125 | header.attr("id", uniqueHeaderId).attr("tabindex", "-1").addClass("title");
|
1121 | 1126 |
|
|
1165 | 1170 | break;
|
1166 | 1171 |
|
1167 | 1172 | case $.fn.steps.contentMode.async:
|
1168 |
| - var currentStepContent = $(".content > .body", wizard).eq(state.currentIndex) |
| 1173 | + var currentStepContent = $(".content > .body", wizard).eq(state.currentIndex).attr("aria-busy", "true") |
1169 | 1174 | .empty().append(renderTemplate(options.loadingTemplate, { text: options.labels.loading }));
|
1170 | 1175 | $.ajax({ url: state.currentStep.contentUrl, cache: false })
|
1171 | 1176 | .done(function (data)
|
1172 | 1177 | {
|
1173 |
| - currentStepContent.empty().html(data).data("loaded", "1"); |
| 1178 | + currentStepContent.empty().html(data).attr("aria-busy", "false").data("loaded", "1"); |
1174 | 1179 | });
|
1175 | 1180 | break;
|
1176 | 1181 | }
|
|
0 commit comments