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:40maint-2.0.2
parent
3045402858
commit
51643f5db9
|
@ -36,6 +36,10 @@ var SOGoResizableTableInterface = {
|
|||
},
|
||||
|
||||
_resize: function() {
|
||||
this.restore();
|
||||
},
|
||||
|
||||
restore: function(relativeWidths) {
|
||||
if (Prototype.Browser.IE)
|
||||
while (SOGoResizableTable._stylesheet.styleSheet.rules.length)
|
||||
SOGoResizableTable._stylesheet.styleSheet.removeRule();
|
||||
|
@ -43,8 +47,10 @@ var SOGoResizableTableInterface = {
|
|||
while (SOGoResizableTable._stylesheet.firstChild)
|
||||
SOGoResizableTable._stylesheet.removeChild(SOGoResizableTable._stylesheet.firstChild);
|
||||
|
||||
if (relativeWidths)
|
||||
this.ratios = relativeWidths;
|
||||
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++) {
|
||||
var cell = cells[i];
|
||||
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() {
|
||||
this.ratios = new Hash();
|
||||
var tableWidth = 100/this.getWidth();
|
||||
|
@ -172,7 +167,7 @@ SOGoResizableTable = {
|
|||
}
|
||||
|
||||
// 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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue