[Lada-commits] [PATCH 4 of 7] Fix rendering the form readonly

Wald Commits scm-commit at wald.intevation.org
Fri Jul 12 15:59:12 CEST 2013


# HG changeset patch
# User Torsten Irländer <torsten.irlaender at intevation.de>
# Date 1373637401 -7200
# Node ID 401d559e046192b52c0a03a089172d5dcc5eb801
# Parent  f3a2f985f451ea03595e099ea23caa76994fcf01
Fix rendering the form readonly.

diff -r f3a2f985f451 -r 401d559e0461 app/view/widgets/LadaForm.js
--- a/app/view/widgets/LadaForm.js	Fri Jul 12 11:49:37 2013 +0200
+++ b/app/view/widgets/LadaForm.js	Fri Jul 12 15:56:41 2013 +0200
@@ -60,8 +60,8 @@
         this.model = model;
         this.loadRecord(model);
         // Set the form to readonly if the models readonly attribute is
-        // anything dffernt from true
-        if (model.get('readonly') !== false) {
+        // true
+        if (model.get('readonly') === true) {
             this.setReadOnly(true);
         }
     },
@@ -131,7 +131,7 @@
             this.warnings = this.translateReturnCodes(json.warnings);
             this.message = Lada.getApplication().bundle.getMsg(json.message);
         } else {
-            this.setReadOnly(true);
+            this.setReadOnly(this.model.get('readonly'));
         }
     }
 });


More information about the Lada-commits mailing list