Skip to content
Permalink
Browse files

Dialog: Fixed #3637: Added role of button to close link.

  • Loading branch information
scottgonzalez committed Dec 6, 2008
1 parent 03909cb commit 6e7e808d692423fe4faa0089a036e9a0c2c1800c
Showing with 27 additions and 1 deletion.
  1. +18 −0 tests/dialog.js
  2. +9 −1 ui/ui.dialog.js
@@ -215,6 +215,24 @@ test("title id", function() {
el.remove();
});

test("ARIA", function() {
expect(4);

el = $('<div></div>').dialog();

equals(dlg().attr('role'), 'dialog', 'dialog role');

var labelledBy = dlg().attr('aria-labelledby');
ok(labelledBy.length > 0, 'has aria-labelledby attribute');
equals(dlg().find('.ui-dialog-title').attr('id'), labelledBy,
'proper aria-labelledby attribute');

equals(dlg().find('.ui-dialog-titlebar-close').attr('role'), 'button',
'close link role');

el.remove();
});

module("dialog: Options");

test("autoOpen", function() {
@@ -52,12 +52,20 @@ $.widget("ui.dialog", {

uiDialogTitlebar = (this.uiDialogTitlebar = $('<div/>'))
.addClass('ui-dialog-titlebar')
.append('<a href="#" class="ui-dialog-titlebar-close"><span>X</span></a>')
.mousedown(function() {
self.moveToTop();
})
.prependTo(uiDialogContainer),

uiDialogTitlebarClose = $('<a href="#"/>')
.addClass('ui-dialog-titlebar-close')
.attr('role', 'button')
.appendTo(uiDialogTitlebar),

uiDialogTitlebarCloseText = (this.uiDialogTitlebarCloseText = $('<span/>'))
.html('X')
.appendTo(uiDialogTitlebarClose),

title = options.title || '&nbsp;',
titleId = $.ui.dialog.getTitleId(this.element),
uiDialogTitle = $('<span/>')

0 comments on commit 6e7e808

Please sign in to comment.
You can’t perform that action at this time.