Dialog: Added hover and focus states to all buttons.

This commit is contained in:
Scott González 2008-12-21 18:00:42 +00:00
parent 77d17fc769
commit c688dab963

View File

@ -95,12 +95,18 @@ $.widget("ui.dialog", {
.attr('role', 'button')
.hover(
function() {
$(this).addClass('ui-state-hover');
uiDialogTitlebarClose.addClass('ui-state-hover');
},
function() {
$(this).removeClass('ui-state-hover');
uiDialogTitlebarClose.removeClass('ui-state-hover');
}
)
.focus(function() {
uiDialogTitlebarClose.addClass('ui-state-focus');
})
.blur(function() {
uiDialogTitlebarClose.removeClass('ui-state-focus');
})
.mousedown(function(ev) {
ev.stopPropagation();
})
@ -255,6 +261,20 @@ $.widget("ui.dialog", {
)
.text(name)
.click(function() { fn.apply(self.element[0], arguments); })
.hover(
function() {
$(this).addClass('ui-state-hover');
},
function() {
$(this).removeClass('ui-state-hover');
}
)
.focus(function() {
$(this).addClass('ui-state-focus');
})
.blur(function() {
$(this).removeClass('ui-state-focus');
})
.appendTo(uiDialogButtonPane);
});
}