Commit f67316a7 authored by Clement Ho's avatar Clement Ho

Hide list if it is dynamic and there are no items to render

parent 0791116f
......@@ -82,12 +82,16 @@ require('../window')(function(w){
}
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();
} else {
} else if (onlyDynamicList && data[0].length !== 0) {
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();
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment