changeset 1034:4d4de99bbe53

Get rid of double setting readOnly status of probe window child elements.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 18 Feb 2016 11:21:22 +0100
parents e4b6b6c5fb89
children 479782c96efa
files app/view/grid/Messung.js app/view/grid/Ortszuordnung.js app/view/grid/PKommentar.js app/view/grid/Probenzusatzwert.js app/view/window/ProbeEdit.js
diffstat 5 files changed, 8 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/app/view/grid/Messung.js	Thu Feb 18 11:19:25 2016 +0100
+++ b/app/view/grid/Messung.js	Thu Feb 18 11:21:22 2016 +0100
@@ -250,7 +250,8 @@
     },
 
     setReadOnly: function(b) {
-        if (b == true){
+        this.readOnly = b;
+        if (b === true) {
             //Readonly
             if (this.getPlugin('rowedit')){
                 this.getPlugin('rowedit').disable();
--- a/app/view/grid/Ortszuordnung.js	Thu Feb 18 11:19:25 2016 +0100
+++ b/app/view/grid/Ortszuordnung.js	Thu Feb 18 11:21:22 2016 +0100
@@ -132,7 +132,8 @@
     },
 
     setReadOnly: function(b) {
-        if (b == true){
+        this.readOnly = b;
+        if (b) {
             //Readonly
             if (this.getPlugin('rowedit')){
                 this.getPlugin('rowedit').disable();
--- a/app/view/grid/PKommentar.js	Thu Feb 18 11:19:25 2016 +0100
+++ b/app/view/grid/PKommentar.js	Thu Feb 18 11:21:22 2016 +0100
@@ -131,7 +131,8 @@
     },
 
     setReadOnly: function(b) {
-        if (b == true){
+        this.readOnly = b;
+        if (b) {
             //Readonly
             if (this.getPlugin('rowedit')){
                 this.getPlugin('rowedit').disable();
--- a/app/view/grid/Probenzusatzwert.js	Thu Feb 18 11:19:25 2016 +0100
+++ b/app/view/grid/Probenzusatzwert.js	Thu Feb 18 11:21:22 2016 +0100
@@ -177,7 +177,8 @@
     },
 
     setReadOnly: function(b) {
-        if (b == true){
+        this.readOnly = b;
+        if (b) {
             //Readonly
             if (this.getPlugin('rowedit')){
                 this.getPlugin('rowedit').disable();
--- a/app/view/window/ProbeEdit.js	Thu Feb 18 11:19:25 2016 +0100
+++ b/app/view/window/ProbeEdit.js	Thu Feb 18 11:21:22 2016 +0100
@@ -182,14 +182,10 @@
             // Disable only when the User is not the owner of the Probe
             // Works in symbiosis with success callback some lines above.
             this.down('fset[name=messungen]').down('messunggrid').setReadOnly(true);
-            this.down('fset[name=messungen]').down('messunggrid').readOnly = true;
         }
         this.down('fset[name=orte]').down('ortgrid').setReadOnly(true);
-        this.down('fset[name=orte]').down('ortgrid').readOnly = true;
         this.down('fset[name=probenzusatzwerte]').down('probenzusatzwertgrid').setReadOnly(true);
-        this.down('fset[name=probenzusatzwerte]').down('probenzusatzwertgrid').readOnly = true;
         this.down('fset[name=pkommentare]').down('pkommentargrid').setReadOnly(true);
-        this.down('fset[name=pkommentare]').down('pkommentargrid').readOnly = true;
     },
 
     /**
@@ -197,13 +193,9 @@
      */
     enableChildren: function() {
         this.down('fset[name=messungen]').down('messunggrid').setReadOnly(false);
-        this.down('fset[name=messungen]').down('messunggrid').readOnly = false;
         this.down('fset[name=orte]').down('ortgrid').setReadOnly(false);
-        this.down('fset[name=orte]').down('ortgrid').readOnly = false;
         this.down('fset[name=probenzusatzwerte]').down('probenzusatzwertgrid').setReadOnly(false);
-        this.down('fset[name=probenzusatzwerte]').down('probenzusatzwertgrid').readOnly = false;
         this.down('fset[name=pkommentare]').down('pkommentargrid').setReadOnly(false);
-        this.down('fset[name=pkommentare]').down('pkommentargrid').readOnly = false;
     },
 
     /**

http://lada.wald.intevation.org