Hide list if it is dynamic and there are no items to render
This commit is contained in:
parent
0791116f5f
commit
f67316a7cb
1 changed files with 7 additions and 3 deletions
|
@ -82,12 +82,16 @@ require('../window')(function(w){
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!self.destroyed) {
|
if (!self.destroyed) {
|
||||||
if (data[0].length === 0) {
|
var hookListChildren = self.hook.list.list.children;
|
||||||
|
var onlyDynamicList = hookListChildren.length === 1 && hookListChildren[0].hasAttribute('data-dynamic');
|
||||||
|
|
||||||
|
if (onlyDynamicList && data[0].length === 0) {
|
||||||
self.hook.list.hide();
|
self.hook.list.hide();
|
||||||
} else {
|
} else if (onlyDynamicList && data[0].length !== 0) {
|
||||||
self.hook.list.show();
|
self.hook.list.show();
|
||||||
self.hook.list.setData.call(self.hook.list, data[0]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.hook.list.setData.call(self.hook.list, data[0]);
|
||||||
}
|
}
|
||||||
self.notLoading();
|
self.notLoading();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue