forked from 0x2620/oxjs
fixing a bug where in a list, the click target loop would not exit when items are added or removed on click
This commit is contained in:
parent
5efe54c0e2
commit
c3b59a62fe
8 changed files with 71 additions and 22 deletions
|
|
@ -61,9 +61,11 @@ Ox.DocPanel = function(options, self) {
|
|||
});
|
||||
|
||||
function loadList(callback) {
|
||||
|
||||
var counter = 0,
|
||||
length = self.options.files.length;
|
||||
docItems = [];
|
||||
|
||||
self.options.files.forEach(function(file) {
|
||||
Ox.doc(self.options.path + file, function(fileItems) {
|
||||
docItems = Ox.merge(docItems, fileItems);
|
||||
|
|
@ -134,6 +136,7 @@ Ox.DocPanel = function(options, self) {
|
|||
*/
|
||||
that.$element.replaceElement(0, self.$list);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function getItemByName(name) {
|
||||
|
|
@ -151,6 +154,7 @@ Ox.DocPanel = function(options, self) {
|
|||
var selected;
|
||||
if (data.ids.length) {
|
||||
selected = data.ids[0];
|
||||
Ox.print('selected', data.ids)
|
||||
if (selected[0] != '_') {
|
||||
self.$page = Ox.DocPage({
|
||||
item: getItemByName(selected)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue