|
343 | 343 | $fieldset, fieldsetClass, fieldsetId, $legend, legendId, thisPref, $thisDiv, thisClass, |
344 | 344 | thisId, $thisLabel, $thisField, options,$thisOption,optionValue,optionLang,optionText, |
345 | 345 | changedPref,changedSpan,changedText, currentDescState, prefDescVoice, $kbHeading,$kbList, |
346 | | - kbLabels,keys,kbListText,$kbListItem, dialog,saveButton,cancelButton; |
| 346 | + kbLabels,keys,kbListText,$kbListItem, dialog,$saveButton,$cancelButton,$buttonContainer; |
347 | 347 |
|
348 | 348 | thisObj = this; |
349 | 349 | available = this.getAvailablePreferences(); |
|
359 | 359 | if (form == 'captions') { |
360 | 360 | formTitle = this.tt.prefTitleCaptions; |
361 | 361 | // Intro text removed in 4.4.32 to cut down on unnecessary verbiage |
362 | | - } |
363 | | - else if (form == 'descriptions') { |
| 362 | + } else if (form == 'descriptions') { |
364 | 363 | formTitle = this.tt.prefTitleDescriptions; |
365 | 364 | var $prefsIntro = $('<p>',{ |
366 | 365 | text: this.tt.prefIntroDescription1 |
|
774 | 773 | } |
775 | 774 |
|
776 | 775 | // $prefsDiv (dialog) must be appended to the BODY! |
777 | | - // otherwise when aria-hidden="true" is applied to all background content |
778 | | - // that will include an ancestor of the dialog, |
779 | | - // which will render the dialog unreadable by screen readers |
780 | 776 | $('body').append($prefsDiv); |
781 | 777 | dialog = new AccessibleDialog($prefsDiv, this.$prefsButton, 'dialog', true, formTitle, $prefsIntro, thisObj.tt.closeButtonLabel, false); |
782 | 778 |
|
783 | 779 | // Add save and cancel buttons. |
784 | | - $prefsDiv.append('<hr>'); |
785 | | - saveButton = $('<button class="modal-button">' + this.tt.save + '</button>'); |
786 | | - cancelButton = $('<button class="modal-button">' + this.tt.cancel + '</button>'); |
787 | | - saveButton.on( 'click', function () { |
| 780 | + $buttonContainer = $( '<div class="able-prefs-buttons"></div>' ); |
| 781 | + $saveButton = $('<button class="modal-button">' + this.tt.save + '</button>'); |
| 782 | + $cancelButton = $('<button class="modal-button">' + this.tt.cancel + '</button>'); |
| 783 | + $saveButton.on( 'click', function () { |
788 | 784 | dialog.hide(); |
789 | 785 | thisObj.savePrefsFromForm(); |
790 | 786 | }); |
791 | | - cancelButton.on( 'click', function () { |
| 787 | + $cancelButton.on( 'click', function () { |
792 | 788 | dialog.hide(); |
793 | 789 | thisObj.resetPrefsForm(); |
794 | 790 | }); |
795 | | - |
796 | | - $prefsDiv.append(saveButton); |
797 | | - $prefsDiv.append(cancelButton); |
798 | | - |
| 791 | + $buttonContainer.append( $saveButton,$cancelButton ); |
| 792 | + $prefsDiv.append($buttonContainer); |
799 | 793 | // Associate the dialog's H1 as aria-labelledby for groups of fields |
800 | 794 | // (alternative to fieldset and legend) |
801 | 795 | if (form === 'captions' || form === 'transcript') { |
|
0 commit comments