From c688dab9636eb95c2ea1d8d544adeaf6f090925b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Sun, 21 Dec 2008 18:00:42 +0000 Subject: [PATCH] Dialog: Added hover and focus states to all buttons. --- ui/ui.dialog.js | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/ui/ui.dialog.js b/ui/ui.dialog.js index 7a7175fad..de463567b 100644 --- a/ui/ui.dialog.js +++ b/ui/ui.dialog.js @@ -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); }); }