From 4428ad4d5cd2310a2839e7c727141aa5a2d99ea9 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Thu, 13 Jan 2011 21:17:48 +0000 Subject: [PATCH] fix lists resize bug --- build/css/ox.ui.css | 1 - build/js/ox.ui.js | 27 +++++++++++++++++---------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/build/css/ox.ui.css b/build/css/ox.ui.css index 109365e6..16734ca7 100644 --- a/build/css/ox.ui.css +++ b/build/css/ox.ui.css @@ -878,7 +878,6 @@ Lists top: 0; right: 0; bottom: 0; - overflow-y: scroll; } .OxTextList .OxBody .OxContent { //width: 100%; diff --git a/build/js/ox.ui.js b/build/js/ox.ui.js index a73e055e..37d2f1d9 100644 --- a/build/js/ox.ui.js +++ b/build/js/ox.ui.js @@ -7358,7 +7358,7 @@ requires .addClass('OxBody') .css({ top: (self.options.columnsVisible ? 16 : 0) + 'px', - overflowY: (self.options.columnsVisible ? 'scroll' : 'auto') + overflowY: (self.options.columnsVisible ? 'scroll' : 'hidden') }) .scroll(function() { var scrollLeft = $(this).scrollLeft(); @@ -7642,7 +7642,11 @@ requires } function getItemWidth() { - return Math.max(Ox.sum(self.columnWidths), that.$element.width() - oxui.scrollbarSize); + return Math.max( + Ox.sum(self.columnWidths), + that.$element.width() - + (self.options.columnsVisible ? oxui.scrollbarSize : 0) + ); //return Ox.sum(self.columnWidths) } @@ -7711,15 +7715,18 @@ requires function resizeColumn(id, width) { var i = getColumnIndexById(id), pos = getColumnPositionById(id); + self.options.columns[i].width = width; self.columnWidths[pos] = width; - that.$head.$content.css({ - width: (Ox.sum(self.columnWidths) + 2) + 'px' - }); - that.$titles[pos].css({ - width: (width - 9 - (i == self.selectedColumn ? 16 : 0)) + 'px' - }); - $('.OxCell.OxColumn' + Ox.toTitleCase(self.options.columns[i].id)).css({ - width: (width - 9) + 'px' + if (self.options.columnsVisible) { + that.$head.$content.css({ + width: (Ox.sum(self.columnWidths) + 2) + 'px' + }); + that.$titles[pos].css({ + width: (width - 9 - (i == self.selectedColumn ? 16 : 0)) + 'px' + }); + } + that.find('.OxCell.OxColumn' + Ox.toTitleCase(self.options.columns[i].id)).css({ + width: (width - (self.options.columnsVisible ? 9 : 8)) + 'px' }); setWidth(); //that.$body.clearCache();