SOGoResizableTable: minor changes to fix some warnings with generated CSS.

Monotone-Parent: 344542a59dbbe26fb20fcc06e0469e8e9fd3ce10
Monotone-Revision: 6e11f6220a9ec4ae00f4c090674fcb8b2910c44d

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2011-12-02T03:11:40
maint-2.0.2
Francis Lachapelle 2011-12-02 03:11:40 +00:00
parent 3045402858
commit 51643f5db9
1 changed files with 8 additions and 13 deletions

View File

@ -36,6 +36,10 @@ var SOGoResizableTableInterface = {
}, },
_resize: function() { _resize: function() {
this.restore();
},
restore: function(relativeWidths) {
if (Prototype.Browser.IE) if (Prototype.Browser.IE)
while (SOGoResizableTable._stylesheet.styleSheet.rules.length) while (SOGoResizableTable._stylesheet.styleSheet.rules.length)
SOGoResizableTable._stylesheet.styleSheet.removeRule(); SOGoResizableTable._stylesheet.styleSheet.removeRule();
@ -43,8 +47,10 @@ var SOGoResizableTableInterface = {
while (SOGoResizableTable._stylesheet.firstChild) while (SOGoResizableTable._stylesheet.firstChild)
SOGoResizableTable._stylesheet.removeChild(SOGoResizableTable._stylesheet.firstChild); SOGoResizableTable._stylesheet.removeChild(SOGoResizableTable._stylesheet.firstChild);
if (relativeWidths)
this.ratios = relativeWidths;
var tableWidth = this.getWidth()/100; var tableWidth = this.getWidth()/100;
var cells = $(this).down('tr').childElements(); var cells = $(this).down('tr').select('.resizable');
for (i = 0; i < cells.length; i++) { for (i = 0; i < cells.length; i++) {
var cell = cells[i]; var cell = cells[i];
var ratio = this.ratios.get(cell.id); var ratio = this.ratios.get(cell.id);
@ -52,17 +58,6 @@ var SOGoResizableTableInterface = {
} }
}, },
restore: function(relativeWidths) {
var tableWidth = this.getWidth()/100;
var cells = $(this).down('tr').childElements();
for (i = 0; i < cells.length; i++) {
var cell = cells[i];
var ratio = relativeWidths.get(cell.id);
SOGoResizableTable._resize(this, $(cell), i, null, ratio*tableWidth);
}
this.ratios = relativeWidths;
},
computeColumnsWidths: function() { computeColumnsWidths: function() {
this.ratios = new Hash(); this.ratios = new Hash();
var tableWidth = 100/this.getWidth(); var tableWidth = 100/this.getWidth();
@ -172,7 +167,7 @@ SOGoResizableTable = {
} }
// Respect the minimum width of the cell. // Respect the minimum width of the cell.
w = Math.max(w - pad, parseInt(cell.getStyle('minWidth'))); w = Math.max(Math.round(w) - pad, parseInt(cell.getStyle('minWidth')));
var delta = w - cell.getWidth() + pad; var delta = w - cell.getWidth() + pad;