diff options
author | Clement Ho <ClemMakesApps@gmail.com> | 2016-12-12 03:05:33 +0300 |
---|---|---|
committer | Clement Ho <ClemMakesApps@gmail.com> | 2017-01-10 01:01:16 +0300 |
commit | 5c0802deae6a3a87e7a497d3250cbeb98e61045b (patch) | |
tree | 7390d2e5fa2f0848b00af75c440b4e320f2a2898 /app | |
parent | acfe967eb587078672953971673e2cd2c02b43ee (diff) |
Add check in case the data attribute does not exist
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/droplab/droplab_ajax.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/assets/javascripts/droplab/droplab_ajax.js b/app/assets/javascripts/droplab/droplab_ajax.js index 629260006f3..ebb518eeef4 100644 --- a/app/assets/javascripts/droplab/droplab_ajax.js +++ b/app/assets/javascripts/droplab/droplab_ajax.js @@ -47,7 +47,11 @@ require('../window')(function(w){ this._loadUrlData(config.endpoint).then(function(d) { 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); }).catch(function(e) { |