webui: do not show empty table footer

Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
This commit is contained in:
Petr Vobornik
2014-06-10 10:23:27 +02:00
parent 21651d9d3f
commit 9c1da611ea
5 changed files with 19 additions and 4 deletions
+1
View File
@@ -472,6 +472,7 @@ IPA.automember.condition_adapter = declare([field_mod.Adapter], {
IPA.automember.condition_widget = function(spec) {
spec = spec || {};
spec.footer = spec.footer === undefined ? false : spec.footer;
spec.columns = $.merge(spec.columns || [], [
{
+4 -2
View File
@@ -678,12 +678,14 @@ IPA.adder_dialog = function(spec) {
var init = function() {
that.available_table = IPA.table_widget({
entity: that.entity,
name: 'available'
name: 'available',
footer: false
});
that.selected_table = IPA.table_widget({
entity: that.entity,
name: 'selected'
name: 'selected',
footer: false
});
if (spec.columns) {
+1
View File
@@ -1629,6 +1629,7 @@ IPA.dns.record_type_table_widget = function(spec) {
spec = spec || {};
spec.columns = spec.columns || [];
spec.footer = spec.footer === undefined ? false : spec.footer;
spec.columns.push({
name: 'position',
+1
View File
@@ -107,6 +107,7 @@ IPA.rule_details_widget = function(spec) {
IPA.rule_association_table_widget = function(spec) {
spec = spec || {};
spec.footer = spec.footer === undefined ? false : spec.footer;
var that = IPA.association_table_widget(spec);
+12 -2
View File
@@ -2393,6 +2393,12 @@ IPA.table_widget = function (spec) {
that.save_values = spec.save_values === undefined ? true : spec.save_values;
that['class'] = spec['class'];
/**
* Flag to render footer
* @property {boolean}
*/
that.footer = spec.footer === undefined ? true : spec.footer;
that.pagination = spec.pagination;
that.current_page = 1;
that.total_pages = 1;
@@ -2521,7 +2527,9 @@ IPA.table_widget = function (spec) {
that.tbody.css('height', that.height);
}
that.create_footer();
if (that.footer) {
that.create_footer();
}
that.set_enabled(that.enabled);
};
@@ -2911,7 +2919,9 @@ IPA.table_widget = function (spec) {
that.clear = function() {
that.empty();
that.summary.text('');
if (that.footer) {
that.summary.text('');
}
};
//column initialization