Commit 7eb888e6 authored by Clement Ho's avatar Clement Ho

Only return data response for droplab ajax filter

parent f67316a7
...@@ -85,13 +85,13 @@ require('../window')(function(w){ ...@@ -85,13 +85,13 @@ require('../window')(function(w){
var hookListChildren = self.hook.list.list.children; var hookListChildren = self.hook.list.list.children;
var onlyDynamicList = hookListChildren.length === 1 && hookListChildren[0].hasAttribute('data-dynamic'); var onlyDynamicList = hookListChildren.length === 1 && hookListChildren[0].hasAttribute('data-dynamic');
if (onlyDynamicList && data[0].length === 0) { if (onlyDynamicList && data.length === 0) {
self.hook.list.hide(); self.hook.list.hide();
} else if (onlyDynamicList && data[0].length !== 0) { } else if (onlyDynamicList && data.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);
} }
self.notLoading(); self.notLoading();
}); });
...@@ -105,7 +105,7 @@ require('../window')(function(w){ ...@@ -105,7 +105,7 @@ require('../window')(function(w){
if(xhr.readyState === XMLHttpRequest.DONE) { if(xhr.readyState === XMLHttpRequest.DONE) {
if (xhr.status === 200) { if (xhr.status === 200) {
var data = JSON.parse(xhr.responseText); var data = JSON.parse(xhr.responseText);
return resolve([data, xhr]); return resolve(data);
} else { } else {
return reject([xhr.responseText, xhr.status]); return reject([xhr.responseText, xhr.status]);
} }
......
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