summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2011-08-23 20:45:06 -0500
committerEndi S. Dewata <edewata@redhat.com>2011-08-25 13:57:08 +0000
commitfcd927a126ebcee2b38e8f8bb05ea38cf018b1e2 (patch)
tree4cd2a326844077b84adb2eeadd5742dfa385979c
parent1936b8050e5ee7861996f370d2171b751f18c1fb (diff)
downloadfreeipa-fcd927a126ebcee2b38e8f8bb05ea38cf018b1e2.tar.gz
freeipa-fcd927a126ebcee2b38e8f8bb05ea38cf018b1e2.tar.xz
freeipa-fcd927a126ebcee2b38e8f8bb05ea38cf018b1e2.zip
Fixed default map type in automount map adder dialog.
The adder dialog for automount map has been modified to select the direct map by default. Ticket #1698
-rw-r--r--install/ui/automount.js125
-rw-r--r--install/ui/dialog.js1
-rw-r--r--install/ui/widget.js1
3 files changed, 62 insertions, 65 deletions
diff --git a/install/ui/automount.js b/install/ui/automount.js
index dc0ca4e67..eeff8a048 100644
--- a/install/ui/automount.js
+++ b/install/ui/automount.js
@@ -86,32 +86,39 @@ IPA.entity_factories.automountmap = function() {
}).
adder_dialog({
factory: IPA.automountmap_adder_dialog,
- fields:[{factory:IPA.method_radio_widget,
- name: 'method',
- undo: false,
- label: IPA.messages.objects.automountmap.map_type,
- options: [
- { value: 'add',
- label: IPA.messages.objects.automountmap.direct },
- { value: 'add_indirect',
- label: IPA.messages.objects.automountmap.indirect }
- ]
- },
- 'automountmapname','description',
- {
- name: 'key',
- label: IPA.get_method_option(
- 'automountmap_add_indirect', 'key').label,
- conditional: true,
- undo: false
- },
- {
- name: 'parentmap',
- label: IPA.get_method_option(
- 'automountmap_add_indirect', 'parentmap').label,
- conditional: true,
- undo: false
- }]
+ fields: [
+ {
+ factory: IPA.radio_widget,
+ name: 'method',
+ undo: false,
+ label: IPA.messages.objects.automountmap.map_type,
+ options: [
+ {
+ value: 'add',
+ label: IPA.messages.objects.automountmap.direct
+ },
+ {
+ value: 'add_indirect',
+ label: IPA.messages.objects.automountmap.indirect
+ }
+ ]
+ },
+ 'automountmapname',
+ 'description',
+ {
+ name: 'key',
+ label: IPA.get_method_option(
+ 'automountmap_add_indirect', 'key').label,
+ conditional: true,
+ undo: false
+ },
+ {
+ name: 'parentmap',
+ label: IPA.get_method_option(
+ 'automountmap_add_indirect', 'parentmap').label,
+ conditional: true,
+ undo: false
+ }]
}).
build();
};
@@ -196,13 +203,35 @@ IPA.automount_key_column = function(spec){
};
-IPA.automountmap_adder_dialog = function(spec){
+IPA.automountmap_adder_dialog = function(spec) {
+
var that = IPA.add_dialog(spec);
- that.super_create = that.create;
- that.create = function(container) {
- that.super_create(container);
- that.disable_conditional_fields();
+ that.create = function() {
+ that.dialog_create();
+
+ var method_field = that.get_field('method');
+
+ var direct_input = $('input[value="add"]', method_field.container);
+ direct_input.change(function() {
+ that.disable_conditional_fields();
+ });
+
+ var indirect_input = $('input[value="add_indirect"]', method_field.container);
+ indirect_input.change(function() {
+ that.enable_conditional_fields();
+ });
+
+ direct_input.click();
+ };
+
+ that.reset = function() {
+ that.dialog_reset();
+
+ var method_field = that.get_field('method');
+
+ var direct_input = $('input[value="add"]', method_field.container);
+ direct_input.click();
};
return that;
@@ -223,37 +252,3 @@ IPA.get_option_values = function(){
});
return values;
};
-
-IPA.method_radio_widget = function(spec){
- var direct = true;
-
- var that = IPA.radio_widget(spec);
-
- that.radio_create = that.create;
-
- that.create = function(container) {
- that.radio_create(container);
- var input = $('input[name="'+that.name+'"]', that.container);
- input.
- filter("[value="+ that.dialog.method+"]").
- attr('checked', true);
-
-
- input.change(function() {
- that.dialog.method = this.value;
-
- if (this.value === 'add_indirect'){
- that.dialog.enable_conditional_fields();
- }else{
- that.dialog.disable_conditional_fields();
- }
- });
- };
-
- that.reset = function(){
- var input = $('input[name="'+that.name+'"]', that.container);
- input.filter("[value=add]").click();
- };
-
- return that;
-};
diff --git a/install/ui/dialog.js b/install/ui/dialog.js
index 45d306158..0d4ac2da3 100644
--- a/install/ui/dialog.js
+++ b/install/ui/dialog.js
@@ -260,6 +260,7 @@ IPA.dialog = function(spec) {
that.dialog_open = that.open;
that.dialog_close = that.close;
that.dialog_save = that.save;
+ that.dialog_reset = that.reset;
var fields = spec.fields || [];
for (var i=0; i<fields.length; i++) {
diff --git a/install/ui/widget.js b/install/ui/widget.js
index 6ae6f5dfb..62af6c16d 100644
--- a/install/ui/widget.js
+++ b/install/ui/widget.js
@@ -967,6 +967,7 @@ IPA.radio_widget = function(spec) {
};
// methods that should be invoked by subclasses
+ that.radio_create = that.create;
that.radio_save = that.save;
return that;