Permalink
Browse files

When hiding, the dialog now returns focus to the previously focused w…

…idget. This works only when one dialog is opened and then closed again. Doesn't work in a series of consecutive dialogs.

git-svn-id: https://qooxdoo-contrib.svn.sourceforge.net/svnroot/qooxdoo-contrib@20525 09f7d036-9b2a-0410-8fbe-9cff4eb17569
  • Loading branch information...
1 parent 6fdf382 commit 885ff81326200b45beb55af0583da022907e18e3 cboulanger committed Jul 14, 2010
Showing with 6 additions and 2 deletions.
  1. +6 −2 source/class/dialog/Dialog.js
@@ -38,7 +38,7 @@ qx.Class.define("dialog.Dialog",
*/
statics :
{
-
+
/**
* Returns a dialog instance by type
* @param type {String}
@@ -455,6 +455,7 @@ qx.Class.define("dialog.Dialog",
root.blockContent( this.getZIndex()-1 );
}
this.setVisibility("visible");
+ this.__previousFocus = qx.ui.core.FocusHandler.getInstance().getActiveWidget();
this.focus();
this.fireEvent("show");
},
@@ -469,7 +470,10 @@ qx.Class.define("dialog.Dialog",
{
this.getApplicationRoot().unblockContent();
}
- this.blur();
+ if ( this.__previousFocus )
+ {
+ this.__previousFocus.focus();
+ }
this.fireEvent("hide");
},

0 comments on commit 885ff81

Please sign in to comment.