Commit 5c0802de authored by Clement Ho's avatar Clement Ho

Add check in case the data attribute does not exist

parent acfe967e
...@@ -47,7 +47,11 @@ require('../window')(function(w){ ...@@ -47,7 +47,11 @@ require('../window')(function(w){
this._loadUrlData(config.endpoint).then(function(d) { this._loadUrlData(config.endpoint).then(function(d) {
if (config.loadingTemplate) { if (config.loadingTemplate) {
hook.list.list.querySelector('[data-loading-template]').outerHTML = self.listTemplate; var dataLoadingTemplate = hook.list.list.querySelector('[data-loading-template]');
if (dataLoadingTemplate) {
dataLoadingTemplate.outerHTML = self.listTemplate;
}
} }
hook.list[config.method].call(hook.list, d); hook.list[config.method].call(hook.list, d);
}).catch(function(e) { }).catch(function(e) {
......
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