From 1a7a5985d92202543273f931aed7af1774ce72ea Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 29 Dec 2011 16:15:59 +0530 Subject: [PATCH] update listLengh in addItems/removeItems --- demos/doc2/js/doc.js | 4 ++-- source/Ox.UI/js/Core/Ox.DocPanel.js | 3 ++- source/Ox.UI/js/List/Ox.List.js | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/demos/doc2/js/doc.js b/demos/doc2/js/doc.js index 2d9a045f..c5845888 100644 --- a/demos/doc2/js/doc.js +++ b/demos/doc2/js/doc.js @@ -32,8 +32,8 @@ Ox.load('UI', { } }, select: function(data) { - if (data.ids) { - document.location.hash = data.ids[0]; + if (data.id) { + document.location.hash = data.id; } } }); diff --git a/source/Ox.UI/js/Core/Ox.DocPanel.js b/source/Ox.UI/js/Core/Ox.DocPanel.js index 1bf65fac..7240cce4 100644 --- a/source/Ox.UI/js/Core/Ox.DocPanel.js +++ b/source/Ox.UI/js/Core/Ox.DocPanel.js @@ -125,7 +125,8 @@ Ox.DocPanel = function(options, self) { }); self.$list = Ox.TreeList({ items: treeItems, - width: self.options.width + //fixme causes strange layout + //width: self.options.size }) .bindEvent({ select: selectItem diff --git a/source/Ox.UI/js/List/Ox.List.js b/source/Ox.UI/js/List/Ox.List.js index bfc02c4f..2a874806 100644 --- a/source/Ox.UI/js/List/Ox.List.js +++ b/source/Ox.UI/js/List/Ox.List.js @@ -1507,6 +1507,7 @@ Ox.List = function(options, self) { }); self.options.items.splice.apply(self.options.items, Ox.merge([pos, 0], items)); self.$items.splice.apply(self.$items, Ox.merge([pos, 0], $items)); + self.listLength += length; //loadItems(); updatePositions(); } @@ -1656,6 +1657,7 @@ Ox.List = function(options, self) { self.selected[i] -= length; } }); + self.listLength -= length; updatePositions(); } }