[Lada-commits] [PATCH] Clone button only activated if an ort has been selected in the grid

Wald Commits scm-commit at wald.intevation.org
Wed Feb 1 18:54:34 CET 2017


# HG changeset patch
# User Maximilian Krambach <mkrambach at intevation.de>
# Date 1485971671 -3600
# Node ID 317ae6bfd647ce5a848281c71ebad629d931448c
# Parent  e9f812528324b496be32afc02e60d6a910fea234
Clone button only activated if an ort has been selected in the grid

diff -r e9f812528324 -r 317ae6bfd647 app/view/window/Ortszuordnung.js
--- a/app/view/window/Ortszuordnung.js	Wed Feb 01 18:00:59 2017 +0100
+++ b/app/view/window/Ortszuordnung.js	Wed Feb 01 18:54:31 2017 +0100
@@ -157,7 +157,8 @@
                         action: 'frommap'
                     }, {
                         text: i18n.getMsg('orte.clone'),
-                        action: 'clone'
+                        action: 'clone',
+                        disabled : true
                     }]
                 }]
             }]
@@ -232,6 +233,7 @@
         this.ortstore.load();
         map.addListener('featureselected', osg.selectOrt, osg);
         osg.addListener('select', map.selectFeature, map);
+        osg.addListener('select', me.activateCloneButton, me);
     },
 
     /**
@@ -258,6 +260,11 @@
      */
     clearMessages: function() {
         //todo this is a stub
+    },
+
+    activateCloneButton: function() {
+        var toolbar = this.down('panel[name=ortgrid]').getDockedItems()[0];
+        toolbar.down('button[action=clone]').enable();
     }
 });
 


More information about the Lada-commits mailing list