From 3d30983359bc7592ef66c76c401ea03e471ea77a Mon Sep 17 00:00:00 2001 From: rolux Date: Sat, 18 Sep 2010 11:24:29 +0000 Subject: [PATCH] preserve scroll position when adding list column --- build/js/ox.ui.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/build/js/ox.ui.js b/build/js/ox.ui.js index 25f3716c..908bdd8a 100644 --- a/build/js/ox.ui.js +++ b/build/js/ox.ui.js @@ -237,7 +237,6 @@ requires callback = data; data = {}; } - console.log('api', action, data) return Ox.Request.send({ url: self.options.apiURL, data: { @@ -6293,7 +6292,7 @@ requires offset = page * self.pageLength, range = [offset, offset + (page < self.pages - 1 ? self.pageLength : self.listLength % self.pageLength)]; - if (Ox.isUndefined(self.$pages[page])) { + if (Ox.isUndefined(self.$pages[page])) { // fixme: unload will have made this undefined already self.requests.push(self.options.request({ keys: keys, range: range, @@ -6331,6 +6330,7 @@ requires !Ox.isUndefined(callback) && callback(); })); } else { + Ox.print('loading a page from cache, this should probably not happen -----------') self.$pages[page].appendTo(that.$content); } } @@ -6630,7 +6630,7 @@ requires } }; - that.clearCache = function() { // used by TextList resizeColumn + that.clearCache = function() { // was used by TextList resizeColumn, now probably no longer necessary self.$pages = []; return that; }; @@ -6640,8 +6640,10 @@ requires }; that.reload = function() { + Ox.print('---------------- list reload, page', self.page) + var page = self.page; clear(); - that.clearCache(); + self.page = page that.$content.empty(); loadPages(self.page); return that; @@ -7119,7 +7121,7 @@ requires return v.id; }) }); - that.$body.clearCache(); + //that.$body.clearCache(); } function resize() { @@ -7140,7 +7142,7 @@ requires width: (width - 9) + 'px' }); setWidth(); - that.$body.clearCache(); + //that.$body.clearCache(); } function setWidth() {