Skip to content

Commit 3e370a4

Browse files
committed
Dialog: Use ._focusable() and ._hoverable().
1 parent 0ef4b4f commit 3e370a4

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

ui/jquery.ui.dialog.js

+2-14
Original file line numberDiff line numberDiff line change
@@ -125,20 +125,6 @@ $.widget("ui.dialog", {
125125
uiDialogTitlebarClose = $( "<a href='#'></a>" )
126126
.addClass( "ui-dialog-titlebar-close ui-corner-all" )
127127
.attr( "role", "button" )
128-
.hover(
129-
function() {
130-
uiDialogTitlebarClose.addClass( "ui-state-hover" );
131-
},
132-
function() {
133-
uiDialogTitlebarClose.removeClass( "ui-state-hover" );
134-
}
135-
)
136-
.focus(function() {
137-
uiDialogTitlebarClose.addClass( "ui-state-focus" );
138-
})
139-
.blur(function() {
140-
uiDialogTitlebarClose.removeClass( "ui-state-focus" );
141-
})
142128
.click(function( event ) {
143129
event.preventDefault();
144130
self.close( event );
@@ -157,6 +143,8 @@ $.widget("ui.dialog", {
157143
.prependTo( uiDialogTitlebar );
158144

159145
uiDialogTitlebar.find( "*" ).add( uiDialogTitlebar ).disableSelection();
146+
this._hoverable( uiDialogTitlebarClose );
147+
this._focusable( uiDialogTitlebarClose );
160148

161149
if ( options.draggable && $.fn.draggable ) {
162150
self._makeDraggable();

0 commit comments

Comments
 (0)