details:   https://code.openbravo.com/erp/devel/pi/rev/56436da527ee
changeset: 22720:56436da527ee
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Tue Mar 18 11:11:05 2014 +0100
summary:   fixed bug 25910: quick launch popup is not closed when item is 
selected

  Focus needs to be reset in order to make keyboard shortcuts work

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-quickrun-widget.js
 |  15 ++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diffs (39 lines):

diff -r c84042acbfab -r 56436da527ee 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-quickrun-widget.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-quickrun-widget.js
     Tue Mar 18 10:59:33 2014 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-quickrun-widget.js
     Tue Mar 18 11:11:05 2014 +0100
@@ -187,6 +187,10 @@
     // }
     // }
     var left = this.getLeftPosition();
+
+    // keep current focus element to reset it after closing the widget
+    this.focusOnHide = isc.EH.getFocusCanvas();
+
     if (isc.Page.isRTL()) {
       left = left - this.layout.getVisibleWidth() + this.getVisibleWidth() + 1;
     }
@@ -237,6 +241,7 @@
   // ** {{{ doHide }}} **
   // Hide the expanded layout.
   doHide: function () {
+    var me = this;
     this.hideClickMask();
     this.layout.hide();
 
@@ -253,6 +258,16 @@
       isc.OBQuickRun.currentQuickRun = null;
     }
 
+    if (isc.isA.Canvas(this.focusOnHide)) {
+      // setting the focus back to a SC component so keyboard shortcuts 
continue
+      // working (they do not if focus is in browser). This is needed to be 
done
+      // with some delay in order to prevent enter key on drop down to be 
triggered
+      // on this new element (see issue #25910)
+      setTimeout(function () {
+        me.focusOnHide.focus();
+      }, 100);
+    }
+
     if (typeof OB.MainView.TabSet.getSelectedTab().pane.tabSelected === 
'function') {
       OB.MainView.TabSet.getSelectedTab().pane.tabSelected();
     }

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to