changeset 1292:317ae6bfd647

Clone button only activated if an ort has been selected in the grid
author Maximilian Krambach <mkrambach@intevation.de>
date Wed, 01 Feb 2017 18:54:31 +0100
parents e9f812528324
children 16a80ca16732
files app/view/window/Ortszuordnung.js
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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();
     }
 });
 

http://lada.wald.intevation.org