--- a/swtr/static/js/main.js +++ b/swtr/static/js/main.js @@ -678,19 +678,24 @@ id: 'linked-data-container', initialize: function() { var self = this; - this.loader_template = _.template($("#loader-template").html()); - $("#linked-data-page").prepend(this.loader_template()); - swtr.LDs = new LDSwts(); - swtr.LDs.getAll({ - what: 'img-anno', - success: function(data) { - swtr.LDs.add(data); - if(!swtr.tagCloudView) { - $("#spinner").remove(); - swtr.tagCloudView = new TagCloudView({collection: swtr.LDs}); + if(!swtr.LDs) { + swtr.LDs = new LDSwts(); + } + if(!swtr.LDs.length) { + console.log(swtr.LDs); + this.loader_template = _.template($("#loader-template").html()); + $("#linked-data-page").prepend(this.loader_template()); + swtr.LDs.getAll({ + what: 'img-anno', + success: function(data) { + swtr.LDs.add(data); + if(!swtr.tagCloudView) { + $("#spinner").remove(); + swtr.tagCloudView = new TagCloudView({collection: swtr.LDs}); + } } - } - }); + }); + } }, destroy: function() { this.cleanUp();