[Lada-commits] [PATCH] Fixed ort filter close actions

Wald Commits scm-commit at wald.intevation.org
Thu Feb 2 14:40:30 CET 2017


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1486042826 -3600
# Node ID 9f15a932a52582af5231e589b1bb7bd3330ee009
# Parent  996607be47528fa0de60015e4ce0b529a88761ee
Fixed ort filter close actions.

diff -r 996607be4752 -r 9f15a932a525 app/controller/grid/Ortszuordnung.js
--- a/app/controller/grid/Ortszuordnung.js	Thu Feb 02 13:46:41 2017 +0100
+++ b/app/controller/grid/Ortszuordnung.js	Thu Feb 02 14:40:26 2017 +0100
@@ -202,6 +202,16 @@
      * Search triggered by textfield key event.
      */
     search: function(field, evt, opts) {
+        if (evt.getKey() === 27) {
+            if (this.resultPanel.isVisible()) {
+                this.resultPanel.close();
+                return;
+            }
+            else {
+                field.up('window').close();
+                return;
+            }
+        }
         this.searchField = field;
         if ((evt.getKey() == 13 || evt.getKey() == 8) && field.getValue() && field.getValue().length > 0) {
             this.execSearch(field, field.getValue());
diff -r 996607be4752 -r 9f15a932a525 app/view/window/OrtFilter.js
--- a/app/view/window/OrtFilter.js	Thu Feb 02 13:46:41 2017 +0100
+++ b/app/view/window/OrtFilter.js	Thu Feb 02 14:40:26 2017 +0100
@@ -23,6 +23,7 @@
     resizable: false,
     shadow: false,
     alwaysOnTop: true,
+    closeAction: 'hide',
 
     initComponent: function() {
         var me = this;
diff -r 996607be4752 -r 9f15a932a525 app/view/window/Ortszuordnung.js
--- a/app/view/window/Ortszuordnung.js	Thu Feb 02 13:46:41 2017 +0100
+++ b/app/view/window/Ortszuordnung.js	Thu Feb 02 14:40:26 2017 +0100
@@ -290,6 +290,15 @@
         }
         osg.setLoading(false);
         map.setLoading(false);
-    }
+    },
+
+    onEsc: function() {
+        var me = this;
+        var search = me.down('textfield[name=search]');
+        if (search.hasFocus) {
+            return;
+        }
+        me.callParent(arguments);
+     }
 });
 


More information about the Lada-commits mailing list