From 6e3a21a1155b620a2362bfb40a139a8f0dc3b5c5 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Fri, 25 Nov 2011 14:44:40 +0100 Subject: Separation of writable update from field load method --- install/ui/field.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'install/ui/field.js') diff --git a/install/ui/field.js b/install/ui/field.js index c1b74ab5..850afcee 100644 --- a/install/ui/field.js +++ b/install/ui/field.js @@ -187,6 +187,13 @@ IPA.field = function(spec) { that.values = ['']; } + that.load_writable(record); + + that.reset(); + }; + + that.load_writable = function(record) { + that.writable = true; if (that.metadata) { @@ -199,14 +206,12 @@ IPA.field = function(spec) { } } - if (that.record.attributelevelrights) { - var rights = that.record.attributelevelrights[that.name]; + if (record.attributelevelrights) { + var rights = record.attributelevelrights[that.name]; if (!rights || rights.indexOf('w') < 0) { that.writable = false; } } - - that.reset(); }; that.reset = function() { -- cgit