Skip to content

Commit

Permalink
When hiding, the dialog now returns focus to the previously focused w…
Browse files Browse the repository at this point in the history
…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
cboulanger committed Jul 14, 2010
1 parent 6fdf382 commit 885ff81
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions source/class/dialog/Dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ qx.Class.define("dialog.Dialog",
*/
statics :
{

/**
* Returns a dialog instance by type
* @param type {String}
Expand Down Expand Up @@ -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");
},
Expand All @@ -469,7 +470,10 @@ qx.Class.define("dialog.Dialog",
{
this.getApplicationRoot().unblockContent();
}
this.blur();
if ( this.__previousFocus )
{
this.__previousFocus.focus();
}
this.fireEvent("hide");
},

Expand Down

0 comments on commit 885ff81

Please sign in to comment.