From 5095eeed5dee1293330b9fa6e8f8902a7dd13c12 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Sun, 7 Aug 2011 22:16:06 +0000 Subject: [PATCH] list updates --- source/Ox.UI/js/List/Ox.IconList.js | 23 +++++++++++++---------- source/Ox.UI/js/List/Ox.List.js | 26 ++++++++++++++------------ 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/source/Ox.UI/js/List/Ox.IconList.js b/source/Ox.UI/js/List/Ox.IconList.js index 2558770c..2470195c 100644 --- a/source/Ox.UI/js/List/Ox.IconList.js +++ b/source/Ox.UI/js/List/Ox.IconList.js @@ -144,15 +144,16 @@ Ox.IconList = function(options, self) { /*@ closePreview close preview - () -> close + () -> the list @*/ that.closePreview = function() { that.$element.closePreview(); + return that; }; /*@ - paste paste to list - (data) -> paste data, returns IconList + paste paste into list + () -> the list @*/ that.paste = function(data) { that.$element.paste(data); @@ -161,7 +162,7 @@ Ox.IconList = function(options, self) { /*@ reloadList reload list - () -> reload iconlist + () -> the list @*/ that.reloadList = function() { that.$element.reloadList(); @@ -169,16 +170,16 @@ Ox.IconList = function(options, self) { }; /*@ - scrollToSelection set key/value - () -> scroll list ot selection + scrollToSelection scroll list to selection + () -> the list @*/ that.scrollToSelection = function() { that.$element.scrollToSelection(); }; /*@ - size set key/value - () -> get size of list + size get size of list + () -> size @*/ that.size = function() { that.$element.size(); @@ -186,8 +187,9 @@ Ox.IconList = function(options, self) { /*@ sortList sort list - (key, operator) -> sort list by key with operator - operator can be + / - + (key, operator) -> the list + key sort key + operator sort operator ("+" or "-") @*/ that.sortList = function(key, operator) { self.options.sort = [{ @@ -196,6 +198,7 @@ Ox.IconList = function(options, self) { }]; updateKeys(); that.$element.sortList(key, operator); + return that; }; /*@ diff --git a/source/Ox.UI/js/List/Ox.List.js b/source/Ox.UI/js/List/Ox.List.js index a8c8e9bb..289a6a9e 100644 --- a/source/Ox.UI/js/List/Ox.List.js +++ b/source/Ox.UI/js/List/Ox.List.js @@ -1427,8 +1427,8 @@ Ox.List = function(options, self) { } /*@ - clearCache empy list cache - () -> empy cache, returns List Element + clearCache empty list cache + () -> the list @*/ that.clearCache = function() { // fixme: was used by TextList resizeColumn, now probably no longer necessary self.$pages = []; @@ -1437,7 +1437,7 @@ Ox.List = function(options, self) { /*@ closePreview close preview - () -> close preview, returns List Element + () -> the list @*/ that.closePreview = function() { self.preview = false; @@ -1446,7 +1446,7 @@ Ox.List = function(options, self) { /*@ paste paste data - (data) -> paste data into list + (data) -> the list data paste object @*/ that.paste = function(data) { @@ -1456,23 +1456,25 @@ Ox.List = function(options, self) { /*@ reloadList reload list contents - () -> returns List Element + () -> the list @*/ that.reloadList = function(stayAtPosition) { - if (stayAtPosition) { - var scrollTop = that.scrollTop(); - updateQuery(function() { - that.scrollTop(scrollTop); - }); + var scrollTop = that.scrollTop(); + if (!self.isAsync) { + loadItems(); + scrollList(); } else { - updateQuery(); + updateQuery(scrollList); + } + function scrollList() { + stayAtPosition && that.scrollTop(scrollTop); } return that; }; /*@ reloadPages reload list pages - () -> returns List Element + () -> the list @*/ that.reloadPages = function() { //Ox.print('---------------- list reload, page', self.page)