From 8f5ff8c6ee5f0c806d4addd35c7ed560bea60825 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Tue, 23 Sep 2014 21:06:27 +0200 Subject: [PATCH] use Ox.Element, not $, so that inner Ox.Elements get collected on remove; when emptying first page, collect Ox.Elements --- source/Ox.UI/js/List/List.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/source/Ox.UI/js/List/List.js b/source/Ox.UI/js/List/List.js index 8d937b84..18095d09 100644 --- a/source/Ox.UI/js/List/List.js +++ b/source/Ox.UI/js/List/List.js @@ -377,7 +377,7 @@ Ox.List = function(options, self) { } function constructEmptyPage(page) { - var i, $page = $('
').addClass('OxPage').css(getPageCSS(page)); + var i, $page = Ox.Element().addClass('OxPage').css(getPageCSS(page)); Ox.loop(getPageLength(page), function() { Ox.ListItem({ construct: self.options.construct @@ -492,7 +492,9 @@ Ox.List = function(options, self) { function emptyFirstPage() { if (self.$pages[0]) { if (self.options.type == 'text') { - self.$pages[0].find('.OxEmpty').remove(); + self.$pages[0].find('.OxEmpty').each(function() { + Ox.getOxElement($(this)).remove(); + }); } else if (self.options.orientation == 'both') { that.$content.css({height: getListSize() + 'px'}); } @@ -851,7 +853,7 @@ Ox.List = function(options, self) { sort: self.options.sort }, function(result) { var $emptyPage = self.$pages[page]; - self.$pages[page] = $('
').addClass('OxPage').css(getPageCSS(page)); + self.$pages[page] = Ox.Element().addClass('OxPage').css(getPageCSS(page)); result.data.items.forEach(function(v, i) { var pos = offset + i; self.$items[pos] = Ox.ListItem({ @@ -1159,6 +1161,7 @@ Ox.List = function(options, self) { } function selectAsYouType(data) { + self.options.items({ keys: [self.options.unique], query: { @@ -1372,7 +1375,7 @@ Ox.List = function(options, self) { clear(); that.$content.empty(); self.$pages = []; - self.$pages[0] = $('
') + self.$pages[0] = Ox.Element() .addClass('OxPage') .css({ left: self.listMargin / 2 + 'px',