changeset 545:7c9475119861 mockup-1.1

Enable the 'details' button only when an item is selected
author Roland Geider <roland.geider@intevation.de>
date Thu, 18 Dec 2014 15:59:47 +0100
parents d2e90f117c20
children 43951e42590c
files app/view/kommentare/List.js app/view/messungen/List.js app/view/messwerte/List.js app/view/mkommentare/List.js app/view/orte/List.js app/view/status/List.js app/view/zusatzwerte/List.js
diffstat 7 files changed, 84 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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();
+            }
+        }
     }
 });
--- 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();
+            }
+        }
     }
 });
--- 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();
+            }
+        }
     }
 });
--- 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();
+            }
+        }
     }
 });
--- 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();
+            }
+        }
     }
 });
--- 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();
+            }
+        }
     }
 });
--- 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();
+            }
+        }
     }
 });

http://lada.wald.intevation.org