Refactored permission target section.

The permission target section has been modified to use widgets
to create the target selection and handle multiple fields.

Ticket #2098
This commit is contained in:
Endi S. Dewata
2011-11-11 22:33:05 -06:00
committed by Adam Young
parent 0f34e0bf82
commit d6d24be289
9 changed files with 267 additions and 368 deletions

View File

@@ -66,6 +66,7 @@ IPA.widget = function(spec) {
that.valid = true;
that.dirty_changed = IPA.observer();
that.value_changed = IPA.observer();
var init = function() {
if (!that.metadata && that.entity) {
@@ -820,7 +821,6 @@ IPA.checkbox_widget = function (spec) {
// default value
that.checked = spec.checked || false;
that.value_changed = IPA.observer();
that.create = function(container) {
@@ -1109,6 +1109,7 @@ IPA.select_widget = function(spec) {
that.select = $('select[name="'+that.name+'"]', that.container);
that.select.change(function() {
that.set_dirty(that.test_dirty());
that.value_changed.notify(that.save(), that);
});
that.create_error_link(container);
@@ -1141,7 +1142,7 @@ IPA.select_widget = function(spec) {
};
that.clear = function() {
that.empty();
$('option', that.select).attr('selected', '');
};
// methods that should be invoked by subclasses