From 80649e453371b174dd83219ebb7f562d30dd02c3 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 25 Feb 2011 16:04:26 +0100 Subject: [PATCH] load items for empty lists --- build/js/ox.ui.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build/js/ox.ui.js b/build/js/ox.ui.js index 9542637d..0e1f6112 100644 --- a/build/js/ox.ui.js +++ b/build/js/ox.ui.js @@ -7656,7 +7656,8 @@ requires that.addItems = function(pos, items) { var $items = [], - length = items.length; + length = items.length + first = self.$items.length == 0; self.selected.forEach(function(v, i) { if (v >= pos) { self.selected[i] += length; @@ -7681,8 +7682,11 @@ requires $item.insertAfter($items[i - 1]); } }); + self.options.items.splice.apply(self.options.items, $.merge([pos, 0], items)); self.$items.splice.apply(self.$items, $.merge([pos, 0], $items)); + if(first) + loadItems(); updatePositions(); }