fixes https://fedorahosted.org/freeipa/ticket/661
From 96b8a718d1648fd737919c682c076e0763dc3480 Mon Sep 17 00:00:00 2001
From: Adam Young <ayo...@redhat.com>
Date: Thu, 23 Dec 2010 14:26:12 -0500
Subject: [PATCH] posix checked
 check box for posix groups selected by default

---
 install/static/group.js  |    6 +++++-
 install/static/widget.js |    7 ++++---
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/install/static/group.js b/install/static/group.js
index 0e7fd070eeb8439e56af3b734babee42bd478406..8a1beeebe307a6c85d7180b2a8376c8339beeabd 100644
--- a/install/static/group.js
+++ b/install/static/group.js
@@ -90,7 +90,11 @@ function ipa_group_add_dialog(spec) {
         that.add_field(ipa_text_widget({name:'cn', undo: false}));
         that.add_field(ipa_text_widget({name:'description', undo: false}));
         // TODO: Replace with i18n label
-        that.add_field(ipa_checkbox_widget({name:'posix', label:'Is this a POSIX group?', undo: false}));
+        that.add_field(ipa_checkbox_widget({
+            name:'posix',
+            label:'Is this a POSIX group?',
+            undo: false,
+            checked:'checked'}));
         that.add_field(ipa_text_widget({name:'gidnumber', undo: false}));
 
         that.add_dialog_init();
diff --git a/install/static/widget.js b/install/static/widget.js
index 4da5df03f55786accd5e98ba0f6c305f021dba9e..dd93dcad35649b0d9fbc47abe4f5501726c7a374 100755
--- a/install/static/widget.js
+++ b/install/static/widget.js
@@ -205,14 +205,15 @@ function ipa_text_widget(spec) {
 function ipa_checkbox_widget(spec) {
 
     spec = spec || {};
-
+    var is_checked = spec.checked || '';
     var that = ipa_widget(spec);
 
     that.create = function(container) {
 
         $('<input/>', {
-            'type': 'checkbox',
-            'name': that.name
+            type: 'checkbox',
+            name: that.name,
+            checked : is_checked
         }).appendTo(container);
 
         if (that.undo) {
-- 
1.7.3.4

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

Reply via email to