Author: sevein
Date: Tue Nov  2 15:54:41 2010
New Revision: 8761

Log:
Restrict/attach key listeners to dialogs instead of document. Fixes issue 1870 
and issue 1873.

Modified:
   trunk/js/dialog.js

Modified: trunk/js/dialog.js
==============================================================================
--- trunk/js/dialog.js  Tue Nov  2 14:40:10 2010        (r8760)
+++ trunk/js/dialog.js  Tue Nov  2 15:54:41 2010        (r8761)
@@ -103,18 +103,18 @@
           postmethod: 'none',
           visible: false });
 
-        this.yuiDialog.cfg.queueProperty('keylisteners', new 
YAHOO.util.KeyListener(document, { keys: 27 }, {
+        this.yuiDialog.render();
+
+        this.yuiDialog.cfg.queueProperty('keylisteners', new 
YAHOO.util.KeyListener(this.yuiDialog.form, { keys: 27 }, {
           fn: handleYuiCancel,
           scope: this.yuiDialog,
           correctScope: true }).enable());
 
-        this.yuiDialog.cfg.queueProperty('keylisteners', new 
YAHOO.util.KeyListener(document, { keys: 13 }, {
+        this.yuiDialog.cfg.queueProperty('keylisteners', new 
YAHOO.util.KeyListener(this.yuiDialog.form, { keys: 13 }, {
           fn: handleYuiSubmit,
           scope: this.yuiDialog,
           correctScope: true }).enable());
-
-        this.yuiDialog.render();
-
+        
         // Remove all showEvent listeners to prevent default "focusFirst"
         // behavior
         this.yuiDialog.showEvent.unsubscribeAll();

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to