From e8d188150d5a96897d08ee02f9c0ce461fef3ff9 Mon Sep 17 00:00:00 2001 From: Rolux Date: Wed, 30 Jun 2010 00:19:41 +0200 Subject: [PATCH] more fixes (list) --- build/js/ox.ui.js | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/build/js/ox.ui.js b/build/js/ox.ui.js index 118515d..3e6526a 100644 --- a/build/js/ox.ui.js +++ b/build/js/ox.ui.js @@ -2382,6 +2382,7 @@ requires type: "text" }) .options(options || {}) + .click(click) .scroll(scroll); $.extend(self, { @@ -2459,6 +2460,10 @@ requires } } + function click(e) { + Ox.print("e.target", e.target); + } + function deselect(pos) { if (isSelected(pos)) { selected.splice(selected.indexOf(pos), 1); @@ -2484,8 +2489,8 @@ requires function getPage() { return self.options.orientation == "vertical" - ? Math.floor(that.scrollTop() / pageHeight) - : Math.floor(that.scrollLeft() / pageWidth); + ? Math.floor(that.scrollTop() / self.pageHeight) + : Math.floor(that.scrollLeft() / self.pageWidth); } function getPrevious() { @@ -2507,7 +2512,7 @@ requires } function loadPage(page, callback) { - Ox.print("loadPage", page, self.pages) + Ox.print("loadPage", page) if (page < 0 || page >= self.pages) { return; } @@ -2540,6 +2545,7 @@ requires self.$items[pos].appendTo(self.$pages[page]) }); self.$pages[page].appendTo(that.$content); + Ox.print(page, "self.$pages", self.$pages) }, keys: self.options.keys, range: range, @@ -2645,6 +2651,12 @@ requires } function unloadPage(page) { + if (page < 0 || page >= self.pages) { + return; + } + Ox.print("unloadPage", page) + Ox.print("self.$pages", self.$pages) + Ox.print(!Ox.isUndefined(self.$pages[page])) !Ox.isUndefined(self.$pages[page]) && self.$pages[page].remove(); } @@ -2663,13 +2675,13 @@ requires Ox.Request.cancel(v); }); self.requests = []; + unloadPages(self.page); $.extend(self, { $items: [], $pages: [], page: 0, selected: [] }); - unloadPages(self.page); that.scrollTop(0); loadPages(self.page); } @@ -2868,7 +2880,7 @@ requires var $item = $("
") .addClass("OxItem") .css({ - width: Ox.sum(self.columnWidths) + "px" + width: Math.max(Ox.sum(self.columnWidths), that.$element.width() - 12) + "px" }) .data("pos", pos); $.each(self.visibleColumns, function(i, v) { @@ -2914,6 +2926,10 @@ requires } + function resize() { + + } + function resizeColumn(id, width) { var i = getColumnIndexById(id), pos = getColumnPositionById(id);