summaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2011-08-18 13:46:44 +0200
committerEndi S. Dewata <edewata@redhat.com>2011-08-19 20:56:06 +0000
commit9363260ca0d10cfeff902f7241c731680074550d (patch)
tree431ee87ed5a770b8fcc3754f8ddee2a0f86b9318 /install
parent4797cddbd0ac922d03943d63ef9ff131e67c71e4 (diff)
downloadfreeipa-9363260ca0d10cfeff902f7241c731680074550d.zip
freeipa-9363260ca0d10cfeff902f7241c731680074550d.tar.gz
freeipa-9363260ca0d10cfeff902f7241c731680074550d.tar.xz
Uncheck checkboxes in association after deletion
https://fedorahosted.org/freeipa/ticket/1639
Diffstat (limited to 'install')
-rw-r--r--install/ui/association.js2
-rw-r--r--install/ui/search.js21
-rw-r--r--install/ui/sudo.js1
-rw-r--r--install/ui/widget.js29
4 files changed, 35 insertions, 18 deletions
diff --git a/install/ui/association.js b/install/ui/association.js
index 37bc95f..4ee4e72 100644
--- a/install/ui/association.js
+++ b/install/ui/association.js
@@ -457,6 +457,7 @@ IPA.association_table_widget = function (spec) {
that.load = function(result) {
that.values = result[that.name] || [];
that.reset();
+ that.unselect_all();
};
that.update = function() {
@@ -1107,6 +1108,7 @@ IPA.association_facet = function (spec) {
that.table.current_page = 1;
that.table.refresh();
+ that.table.unselect_all();
};
that.refresh = function() {
diff --git a/install/ui/search.js b/install/ui/search.js
index bee55c0..454ecf4 100644
--- a/install/ui/search.js
+++ b/install/ui/search.js
@@ -86,6 +86,17 @@ IPA.search_facet = function(spec) {
that.table.refresh = function() {
that.refresh();
};
+
+ that.table.load = function(result) {
+ that.table.empty();
+
+ for (var i = 0; i<result.length; i++) {
+ var record = that.table.get_record(result[i], 0);
+ that.table.add_record(record);
+ }
+
+ that.table.unselect_all();
+ };
}
that.create_content = function(container) {
@@ -224,13 +235,7 @@ IPA.search_facet = function(spec) {
};
function load(result) {
-
- that.table.empty();
-
- for (var i = 0; i<result.length; i++) {
- var record = that.table.get_record(result[i], 0);
- that.table.add_record(record);
- }
+ that.table.load(result);
}
that.load = spec.load || load;
@@ -245,8 +250,6 @@ IPA.search_facet = function(spec) {
that.search_refresh = function(entity){
- $('input[type=checkbox]',that.table.thead).removeAttr("checked");
-
function on_success(data, text_status, xhr) {
that.load(data.result.result);
diff --git a/install/ui/sudo.js b/install/ui/sudo.js
index 280bec4..095480a 100644
--- a/install/ui/sudo.js
+++ b/install/ui/sudo.js
@@ -1139,6 +1139,7 @@ IPA.sudorule_association_table_widget = function(spec) {
$.merge(that.values, external_values);
}
that.reset();
+ that.unselect_all();
};
return that;
diff --git a/install/ui/widget.js b/install/ui/widget.js
index e30cacd..f88bba5 100644
--- a/install/ui/widget.js
+++ b/install/ui/widget.js
@@ -1263,16 +1263,11 @@ IPA.table_widget = function (spec) {
}).appendTo(th);
select_all_checkbox.change(function() {
- var checked = select_all_checkbox.is(':checked');
- select_all_checkbox.attr(
- 'title', checked ?
- IPA.messages.search.unselect_all :
- IPA.messages.search.select_all);
- var checkboxes = $('input[name=select]', that.tbody).get();
- for (var i=0; i<checkboxes.length; i++) {
- checkboxes[i].checked = checked;
+ if(select_all_checkbox.is(':checked')) {
+ that.select_all();
+ } else {
+ that.unselect_all();
}
- that.select_changed();
return false;
});
}
@@ -1449,6 +1444,21 @@ IPA.table_widget = function (spec) {
that.select_changed = function() {
};
+ that.select_all = function() {
+ $('input[name=select]', that.thead).attr('checked', true).
+ attr('title', IPA.messages.search.unselect_all);
+ $('input[name=select]', that.tbody).attr('checked', true);
+ that.select_changed();
+ };
+
+ that.unselect_all = function() {
+ $('input[name=select]', that.thead).attr('checked', false).
+ attr('title', IPA.messages.search.select_all);
+ $('input[name=select]', that.tbody).attr('checked', false);
+
+ that.select_changed();
+ };
+
that.empty = function() {
that.tbody.empty();
};
@@ -1464,6 +1474,7 @@ IPA.table_widget = function (spec) {
var record = that.get_record(result, i);
that.add_record(record);
}
+ that.unselect_all();
};
that.save = function() {