[Lada-commits] [PATCH] Enable the 'details' button only when an item is selected

Wald Commits scm-commit at wald.intevation.org
Thu Dec 18 16:02:21 CET 2014


# HG changeset patch
# User Roland Geider <roland.geider at intevation.de>
# Date 1418914787 -3600
# Node ID 7c9475119861ebfd4c2f6ee25a5f053aa13b2af7
# Parent  d2e90f117c2060b819b0843c98236e417f5db7d8
Enable the 'details' button only when an item is selected

diff -r d2e90f117c20 -r 7c9475119861 app/view/kommentare/List.js
--- a/app/view/kommentare/List.js	Thu Dec 18 15:04:21 2014 +0100
+++ b/app/view/kommentare/List.js	Thu Dec 18 15:59:47 2014 +0100
@@ -40,7 +40,8 @@
             items: ['->', {
                 text: 'Details',
                 icon: 'gfx/document-open.png',
-                action: 'open'
+                action: 'open',
+                disabled: true
             }, {
                 text: 'Hinzufügen',
                 icon: 'gfx/list-add.png',
@@ -76,5 +77,15 @@
             }
         }];
         this.callParent(arguments);
+    },
+    listeners: {
+        selectionchange: function(model, selected, eOpts) {
+            /*
+            * Enable the 'details' button only when an item is selected
+            */
+            if (selected.length > 0) {
+                this.down('button[action=open]').enable();
+            }
+        }
     }
 });
diff -r d2e90f117c20 -r 7c9475119861 app/view/messungen/List.js
--- a/app/view/messungen/List.js	Thu Dec 18 15:04:21 2014 +0100
+++ b/app/view/messungen/List.js	Thu Dec 18 15:59:47 2014 +0100
@@ -37,7 +37,8 @@
             items: ['->', {
                 text: 'Details',
                 icon: 'gfx/document-open.png',
-                action: 'open'
+                action: 'open',
+                disabled: true
             }, {
                 text: 'Hinzufügen',
                 icon: 'gfx/list-add.png',
@@ -141,5 +142,15 @@
             }
         }];
         this.callParent(arguments);
+    },
+    listeners: {
+        selectionchange: function(model, selected, eOpts) {
+            /*
+            * Enable the 'details' button only when an item is selected
+            */
+            if (selected.length > 0) {
+                this.down('button[action=open]').enable();
+            }
+        }
     }
 });
diff -r d2e90f117c20 -r 7c9475119861 app/view/messwerte/List.js
--- a/app/view/messwerte/List.js	Thu Dec 18 15:04:21 2014 +0100
+++ b/app/view/messwerte/List.js	Thu Dec 18 15:59:47 2014 +0100
@@ -40,7 +40,8 @@
             items: ['->', {
                 text: 'Details',
                 icon: 'gfx/document-open.png',
-                action: 'open'
+                action: 'open',
+                disabled: true
             }, {
                 text: 'Hinzufügen',
                 icon: 'gfx/list-add.png',
@@ -111,5 +112,15 @@
             }
         }];
         this.callParent(arguments);
+    },
+    listeners: {
+        selectionchange: function(model, selected, eOpts) {
+            /*
+            * Enable the 'details' button only when an item is selected
+            */
+            if (selected.length > 0) {
+                this.down('button[action=open]').enable();
+            }
+        }
     }
 });
diff -r d2e90f117c20 -r 7c9475119861 app/view/mkommentare/List.js
--- a/app/view/mkommentare/List.js	Thu Dec 18 15:04:21 2014 +0100
+++ b/app/view/mkommentare/List.js	Thu Dec 18 15:59:47 2014 +0100
@@ -40,7 +40,8 @@
             items: ['->', {
                 text: 'Details',
                 icon: 'gfx/document-open.png',
-                action: 'open'
+                action: 'open',
+                disabled: true
             }, {
                 text: 'Hinzufügen',
                 icon: 'gfx/list-add.png',
@@ -77,5 +78,15 @@
             }
         }];
         this.callParent(arguments);
+    },
+     listeners: {
+        selectionchange: function(model, selected, eOpts) {
+            /*
+            * Enable the 'details' button only when an item is selected
+            */
+            if (selected.length > 0) {
+                this.down('button[action=open]').enable();
+            }
+        }
     }
 });
diff -r d2e90f117c20 -r 7c9475119861 app/view/orte/List.js
--- a/app/view/orte/List.js	Thu Dec 18 15:04:21 2014 +0100
+++ b/app/view/orte/List.js	Thu Dec 18 15:59:47 2014 +0100
@@ -40,7 +40,8 @@
             items: ['->', {
                 text: 'Details',
                 icon: 'gfx/document-open.png',
-                action: 'open'
+                action: 'open',
+                disabled: true
             }, {
                 text: 'Hinzufügen',
                 icon: 'gfx/list-add.png',
@@ -105,5 +106,15 @@
             //}
         }];
         this.callParent(arguments);
+    },
+    listeners: {
+        selectionchange: function(model, selected, eOpts) {
+            /*
+            * Enable the 'details' button only when an item is selected
+            */
+            if (selected.length > 0) {
+                this.down('button[action=open]').enable();
+            }
+        }
     }
 });
diff -r d2e90f117c20 -r 7c9475119861 app/view/status/List.js
--- a/app/view/status/List.js	Thu Dec 18 15:04:21 2014 +0100
+++ b/app/view/status/List.js	Thu Dec 18 15:59:47 2014 +0100
@@ -38,7 +38,8 @@
             items: ['->', {
                 text: 'Details',
                 icon: 'gfx/document-open.png',
-                action: 'open'
+                action: 'open',
+                disabled: true
             }, {
                 text: 'Hinzufügen',
                 icon: 'gfx/list-add.png',
@@ -81,5 +82,15 @@
             }
         }];
         this.callParent(arguments);
+    },
+    listeners: {
+        selectionchange: function(model, selected, eOpts) {
+            /*
+            * Enable the 'details' button only when an item is selected
+            */
+            if (selected.length > 0) {
+                this.down('button[action=open]').enable();
+            }
+        }
     }
 });
diff -r d2e90f117c20 -r 7c9475119861 app/view/zusatzwerte/List.js
--- a/app/view/zusatzwerte/List.js	Thu Dec 18 15:04:21 2014 +0100
+++ b/app/view/zusatzwerte/List.js	Thu Dec 18 15:59:47 2014 +0100
@@ -37,7 +37,8 @@
             items: ['->', {
                 text: 'Details',
                 icon: 'gfx/document-open.png',
-                action: 'open'
+                action: 'open',
+                disabled: true
             }, {
                 text: 'Hinzufügen',
                 icon: 'gfx/list-add.png',
@@ -103,5 +104,15 @@
             }*/
         }];
         this.callParent(arguments);
+    },
+    listeners: {
+        selectionchange: function(model, selected, eOpts) {
+            /*
+            * Enable the 'details' button only when an item is selected
+            */
+            if (selected.length > 0) {
+                this.down('button[action=open]').enable();
+            }
+        }
     }
 });


More information about the Lada-commits mailing list