Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 885ff81326200b45beb55af0583da022907e18e3 1 parent 6fdf382
cboulanger authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 source/class/dialog/Dialog.js
View
8 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");
},
Please sign in to comment.
Something went wrong with that request. Please try again.