From 99727fd0b5f61564bedc1b7b66dae00e43a72986 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Thu, 5 Aug 2010 21:23:48 +0000 Subject: [PATCH] See ChangeLog. Monotone-Parent: 4ebbfbccc5eec87857b36901546058740ff96f2b Monotone-Revision: 3ed5547660c034b85d2587a802d66c09ecb62b0c Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2010-08-05T21:23:48 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 7 +++++++ UI/WebServerResources/SOGoResizableTable.js | 9 +++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0818b5e56..48810dcc9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-08-05 Francis Lachapelle + + * UI/WebServerResources/SOGoResizableTable.js + (computeColumnsWidths): was previous part of saveColumnsState. + Used when the user hasn't modify the columns widths but the local "ratios" + hash still need to be built. + 2010-08-04 Francis Lachapelle * UI/WebServerResources/generic.js (createDialog): when the diff --git a/UI/WebServerResources/SOGoResizableTable.js b/UI/WebServerResources/SOGoResizableTable.js index 86becd48a..9bde09c52 100644 --- a/UI/WebServerResources/SOGoResizableTable.js +++ b/UI/WebServerResources/SOGoResizableTable.js @@ -24,11 +24,12 @@ var SOGoResizableTableInterface = { } SOGoResizableTable._resize(this, $(cell), i, null, cell.getWidth()); } + this.computeColumnsWidths(); Event.observe(window, "resize", this.resize.bind(this)); }, resize: function(e) { - // Only resize the columns after a certain delay, otherwise it slow + // Only resize the columns after a certain delay, otherwise it slows // down the interface. if (this.delayedResize) window.clearTimeout(this.delayedResize); this.delayedResize = this._resize.bind(this).delay(0.2); @@ -62,7 +63,7 @@ var SOGoResizableTableInterface = { this.ratios = relativeWidths; }, - saveColumnsState: function() { + computeColumnsWidths: function() { this.ratios = new Hash(); var tableWidth = 100/this.getWidth(); var cells = $(this).down('tr').childElements(); @@ -71,6 +72,10 @@ var SOGoResizableTableInterface = { if (cell.hasClassName('resizable')) this.ratios.set(cell.id, Math.round(cell.getWidth()*tableWidth)); } + }, + + saveColumnsState: function() { + this.computeColumnsWidths(); if (!$(document.body).hasClassName("popup")) { var url = ApplicationBaseURL + "saveColumnsState"; var data = this.ratios;