From 1c4104e08db36f8c3937ef530e173ce97ca24972 Mon Sep 17 00:00:00 2001 From: Arvind Date: Sat, 30 Aug 2014 14:22:48 +0530 Subject: [PATCH] Fix: TagCloudView was getting initialized every time a user comes to the linked-data page. Check if the view has already been initialized and then initialize a new one if needed. --- swtr/static/js/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/swtr/static/js/main.js b/swtr/static/js/main.js index c311c5c..c328079 100644 --- a/swtr/static/js/main.js +++ b/swtr/static/js/main.js @@ -695,14 +695,14 @@ swtr.LDs.getAll({what: 'img-anno', success: function(data) { swtr.LDs.add(data); - this.tagCloudView = new TagCloudView({collection: swtr.LDs}); + if(!swtr.tagCloudView) { + swtr.tagCloudView = new TagCloudView({collection: swtr.LDs}); + } }}); }, destroy: function() { this.remove(); - // $('#user-tag-cloud').html(''); - // $('#tags-tag-cloud').html(''); } }); -- 1.7.10.4