summaryrefslogtreecommitdiffstats
path: root/install/ui/widget.js
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2011-12-09 14:13:17 +0100
committerEndi S. Dewata <edewata@redhat.com>2011-12-09 22:46:12 +0000
commit34e357e7138ee838583f69001c1d2ad067c98b27 (patch)
tree2bbed0127d3656ee5a1af203064aa9bc246e8a4f /install/ui/widget.js
parent790ffc42a8e9ebd549eebffdef05da28ee96e129 (diff)
downloadfreeipa.git-34e357e7138ee838583f69001c1d2ad067c98b27.tar.gz
freeipa.git-34e357e7138ee838583f69001c1d2ad067c98b27.tar.xz
freeipa.git-34e357e7138ee838583f69001c1d2ad067c98b27.zip
Additional better displaying of long names
- facet group headers, error dialog, non-scrollable tables, can manage long names Size calculation of scrollable and non-scrollable tables was united. Now these types of tables differ only by style. https://fedorahosted.org/freeipa/ticket/1821
Diffstat (limited to 'install/ui/widget.js')
-rw-r--r--install/ui/widget.js48
1 files changed, 21 insertions, 27 deletions
diff --git a/install/ui/widget.js b/install/ui/widget.js
index ffbcbadf..69fe704b 100644
--- a/install/ui/widget.js
+++ b/install/ui/widget.js
@@ -1091,32 +1091,27 @@ IPA.table_widget = function (spec) {
th = $('<th/>').appendTo(tr);
- if (that.scrollable) {
- var width;
- if (column.width) {
- width = parseInt(
- column.width.substring(0, column.width.length-2),10);
- width += 16;
- } else {
- /* don't use the checkbox column as part of the overall
- calculation for column widths. It is so small
- that it throws off the average. */
- width = (that.table.width() - 4 -
- ((that.selectable ?
- IPA.checkbox_column_width : 0) + 14)) /
- columns.length;
- width -= 16; //cell padding, border, spacing
- }
- width += 'px';
- th.css('width', width);
- th.css('max-width', width);
- column.width = width;
+ var width;
+ var cell_spacing = 16; //cell padding(2x6px), border (2x1px), spacing (2px)
+ if (column.width) {
+ width = parseInt(
+ column.width.substring(0, column.width.length-2),10);
+ width += 16;
} else {
- if (column.width) {
- th.css('width', column.width);
- th.css('max-width', column.width);
- }
+ /* don't use the checkbox column as part of the overall
+ calculation for column widths. It is so small
+ that it throws off the average. */
+ width = (that.thead.width() -
+ 2 - //first cell spacing
+ ((that.selectable ? IPA.checkbox_column_width +
+ cell_spacing : 0))) /
+ columns.length;
+ width -= cell_spacing;
}
+ width += 'px';
+ th.css('width', width);
+ th.css('max-width', width);
+ column.width = width;
var label = column.label;
@@ -1131,9 +1126,7 @@ IPA.table_widget = function (spec) {
'style': 'float: right;'
}).appendTo(th);
}
- if (that.scrollable && !column.width){
- column.width = th.width() +'px';
- }
+
}
that.tbody = $('<tbody/>').appendTo(that.table);
@@ -1174,6 +1167,7 @@ IPA.table_widget = function (spec) {
width = parseInt(
column.width.substring(0, column.width.length-2),10);
width += 7; //data cells lack right padding
+ width += 'px';
td.css('width', width);
td.css('max-width', width);
}