For the 'add and add again' useage.
From cd57386340acaaf5d168d48942ee19020bb6f3ee Mon Sep 17 00:00:00 2001
From: Adam Young <ayo...@redhat.com>
Date: Mon, 1 Nov 2010 13:42:28 -0400
Subject: [PATCH] Clear fields after add

---
 install/static/add.js |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/install/static/add.js b/install/static/add.js
index b5f9c16d4abcb74847f27030b6a317b8b1ce45c6..7a9389347ff3cef10f4215926c3459b25e8a638b 100644
--- a/install/static/add.js
+++ b/install/static/add.js
@@ -109,22 +109,22 @@ function ipa_add_dialog(spec) {
                 state[that.entity_name + '-facet'] = 'details';
                 state[that.entity_name + '-pkey'] = pkey[0];
                 $.bbq.pushState(state);
+            }else{
+                dialog.find('input').each( function () {$(this).val(''); });
             }
-        }
-
-        for (var i = 0; i < that.fields.length; ++i) {
-            var field = that.fields[i];
-            if (field.setup) {
-                var value = field.setup(dialog, IPA_ADD_UPDATE);
-                if (value != null) {
-                    if (field.name == pkey_name)
-                        pkey = [value];
-                    else
+            for (var i = 0; i < that.fields.length; ++i) {
+                var field = that.fields[i];
+                if (field.setup) {
+                    var value = field.setup(dialog, IPA_ADD_UPDATE);
+                    if (value != null) {
+                        if (field.name == pkey_name)
+                            pkey = [value];
+                    } else {
                         options[field.name] = value;
+                    }
                 }
             }
         }
-
         dialog.find('input').each(function () {
             var jobj = $(this);
             var attr = jobj.attr('name');
-- 
1.7.1

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to