Skip to content

Commit 69abbf4

Browse files
committed
Remove hr and wrap controls in dialogs
1 parent 6a91d0d commit 69abbf4

2 files changed

Lines changed: 12 additions & 16 deletions

File tree

‎scripts/dragdrop.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@
251251

252252
// inner container for all content, will be assigned to modal div's aria-describedby
253253
$resizeWrapper = $('<div></div>');
254+
$resizeControls = $( '<div class="able-prefs-buttons"></div>' );
254255

255256
// width field
256257
$resizeWidthDiv = $('<div></div>');
@@ -309,7 +310,8 @@
309310
$resizeWidthDiv.append($resizeWidthLabel,$resizeWidthInput);
310311
$resizeHeightDiv.append($resizeHeightLabel,$resizeHeightInput);
311312
$resizeWrapper.append($resizeWidthDiv,$resizeHeightDiv);
312-
$resizeForm.append($resizeWrapper,'<hr>',$saveButton,$cancelButton);
313+
$resizeControls.append($saveButton,$cancelButton);
314+
$resizeForm.append($resizeWrapper,$resizeControls);
313315

314316
// must be appended to the BODY!
315317
// otherwise when aria-hidden="true" is applied to all background content

‎scripts/preference.js‎

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@
343343
$fieldset, fieldsetClass, fieldsetId, $legend, legendId, thisPref, $thisDiv, thisClass,
344344
thisId, $thisLabel, $thisField, options,$thisOption,optionValue,optionLang,optionText,
345345
changedPref,changedSpan,changedText, currentDescState, prefDescVoice, $kbHeading,$kbList,
346-
kbLabels,keys,kbListText,$kbListItem, dialog,saveButton,cancelButton;
346+
kbLabels,keys,kbListText,$kbListItem, dialog,$saveButton,$cancelButton,$buttonContainer;
347347

348348
thisObj = this;
349349
available = this.getAvailablePreferences();
@@ -359,8 +359,7 @@
359359
if (form == 'captions') {
360360
formTitle = this.tt.prefTitleCaptions;
361361
// Intro text removed in 4.4.32 to cut down on unnecessary verbiage
362-
}
363-
else if (form == 'descriptions') {
362+
} else if (form == 'descriptions') {
364363
formTitle = this.tt.prefTitleDescriptions;
365364
var $prefsIntro = $('<p>',{
366365
text: this.tt.prefIntroDescription1
@@ -774,28 +773,23 @@
774773
}
775774

776775
// $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
780776
$('body').append($prefsDiv);
781777
dialog = new AccessibleDialog($prefsDiv, this.$prefsButton, 'dialog', true, formTitle, $prefsIntro, thisObj.tt.closeButtonLabel, false);
782778

783779
// 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 () {
788784
dialog.hide();
789785
thisObj.savePrefsFromForm();
790786
});
791-
cancelButton.on( 'click', function () {
787+
$cancelButton.on( 'click', function () {
792788
dialog.hide();
793789
thisObj.resetPrefsForm();
794790
});
795-
796-
$prefsDiv.append(saveButton);
797-
$prefsDiv.append(cancelButton);
798-
791+
$buttonContainer.append( $saveButton,$cancelButton );
792+
$prefsDiv.append($buttonContainer);
799793
// Associate the dialog's H1 as aria-labelledby for groups of fields
800794
// (alternative to fieldset and legend)
801795
if (form === 'captions' || form === 'transcript') {

0 commit comments

Comments
 (0)