EditableList api calls must not return nested list items

This commit is contained in:
Nick O'Leary 2020-04-27 11:04:41 +01:00
parent 2eaea02489
commit 0150769c17
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
1 changed files with 8 additions and 8 deletions

View File

@ -183,7 +183,7 @@
if (this.options.resizeItem) {
var that = this;
this.element.children().each(function(i) {
that.options.resizeItem($(this).find(".red-ui-editableList-item-content"),i);
that.options.resizeItem($(this).children(".red-ui-editableList-item-content"),i);
});
}
},
@ -223,7 +223,7 @@
var items = this.element.children();
var that = this;
items.sort(function(A,B) {
return that.activeSort($(A).find(".red-ui-editableList-item-content").data('data'),$(B).find(".red-ui-editableList-item-content").data('data'));
return that.activeSort($(A).children(".red-ui-editableList-item-content").data('data'),$(B).children(".red-ui-editableList-item-content").data('data'));
});
$.each(items,function(idx,li) {
that.element.append(li);
@ -305,7 +305,7 @@
}
if (this.options.addItem) {
var index = that.element.children().length-1;
setTimeout(function() {
// setTimeout(function() {
that.options.addItem(row,index,data);
if (that.activeFilter) {
try {
@ -321,7 +321,7 @@
that.uiContainer.scrollTop(that.element.height());
},0);
}
},0);
// },0);
}
},
addItem: function(data) {
@ -334,7 +334,7 @@
},
removeItem: function(data) {
var items = this.element.children().filter(function(f) {
return data === $(this).find(".red-ui-editableList-item-content").data('data');
return data === $(this).children(".red-ui-editableList-item-content").data('data');
});
items.remove();
if (this.options.removeItem) {
@ -342,7 +342,7 @@
}
},
items: function() {
return this.element.children().map(function(i) { return $(this).find(".red-ui-editableList-item-content"); });
return this.element.children().map(function(i) { return $(this).children(".red-ui-editableList-item-content"); });
},
empty: function() {
this.element.empty();
@ -365,14 +365,14 @@
},
show: function(item) {
var items = this.element.children().filter(function(f) {
return item === $(this).find(".red-ui-editableList-item-content").data('data');
return item === $(this).children(".red-ui-editableList-item-content").data('data');
});
if (items.length > 0) {
this.uiContainer.scrollTop(this.uiContainer.scrollTop()+items.position().top)
}
},
getItem: function(li) {
var el = li.find(".red-ui-editableList-item-content");
var el = li.children(".red-ui-editableList-item-content");
if (el.length) {
return el.data('data');
} else {