{"action":"created","comment":{"url":"https://api.github.com/repos/Kitware/minerva/pulls/comments/40679544","id":40679544,"diff_hunk":"@@ -20,17 +20,13 @@ minerva.views.SourcePanel = minerva.View.extend({\n     displayWmsLayersList: function (evt) {\n         var el = $(evt.currentTarget);\n         var wmsSource = this.sourceCollection.get(el.attr('cid'));\n-        if (!this.wmsLayersListWidget) {\n-            this.wmsLayersListWidget = new minerva.views.WmsLayersListWidget({\n-                el: $('#g-dialog-container'),\n-                source: wmsSource,\n-                collection: this.datasetCollection,\n-                parentView: this\n-            });\n-            this.wmsLayersListWidget.render();\n-        } else {\n-            this.wmsLayersListWidget.setCurrentSource(wmsSource);\n-        }\n+        this.wmsLayersListWidget = new minerva.views.WmsLayersListWidget({","path":"web_external/js/views/body/SourcePanel.js","position":15,"original_position":15,"commit_id":"22d580d2ebdc7a7b86ba0e0ef860c7c9b1f6f4df","original_commit_id":"22d580d2ebdc7a7b86ba0e0ef860c7c9b1f6f4df","user":{"login":"mbertrand","id":187676,"avatar_url":"https://avatars.githubusercontent.com/u/187676?v=3","gravatar_id":"","url":"https://api.github.com/users/mbertrand","html_url":"https://github.com/mbertrand","followers_url":"https://api.github.com/users/mbertrand/followers","following_url":"https://api.github.com/users/mbertrand/following{/other_user}","gists_url":"https://api.github.com/users/mbertrand/gists{/gist_id}","starred_url":"https://api.github.com/users/mbertrand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbertrand/subscriptions","organizations_url":"https://api.github.com/users/mbertrand/orgs","repos_url":"https://api.github.com/users/mbertrand/repos","events_url":"https://api.github.com/users/mbertrand/events{/privacy}","received_events_url":"https://api.github.com/users/mbertrand/received_events","type":"User","site_admin":false},"body":"@mgrauer, if I add this snippet just before line 23 then the dupe issue goes away:\r\n```\r\n        if (this.wmsLayersListWidget) {\r\n            this.wmsLayersListWidget.destroy();\r\n        }\r\n```\r\nBut maybe this isn't as efficient as reusing the existing widget.  What do you think?","created_at":"2015-09-29T14:39:47Z","updated_at":"2015-09-29T14:39:47Z","html_url":"https://github.com/Kitware/minerva/pull/127#discussion_r40679544","pull_request_url":"https://api.github.com/repos/Kitware/minerva/pulls/127","_links":{"self":{"href":"https://api.github.com/repos/Kitware/minerva/pulls/comments/40679544"},"html":{"href":"https://github.com/Kitware/minerva/pull/127#discussion_r40679544"},"pull_request":{"href":"https://api.github.com/repos/Kitware/minerva/pulls/127"}}},"pull_request":{"url":"https://api.github.com/repos/Kitware/minerva/pulls/127","id":46203679,"html_url":"https://github.com/Kitware/minerva/pull/127","diff_url":"https://github.com/Kitware/minerva/pull/127.diff","patch_url":"https://github.com/Kitware/minerva/pull/127.patch","issue_url":"https://api.github.com/repos/Kitware/minerva/issues/127","number":127,"state":"open","locked":false,"title":"Fix for issue 121","user":{"login":"mbertrand","id":187676,"avatar_url":"https://avatars.githubusercontent.com/u/187676?v=3","gravatar_id":"","url":"https://api.github.com/users/mbertrand","html_url":"https://github.com/mbertrand","followers_url":"https://api.github.com/users/mbertrand/followers","following_url":"https://api.github.com/users/mbertrand/following{/other_user}","gists_url":"https://api.github.com/users/mbertrand/gists{/gist_id}","starred_url":"https://api.github.com/users/mbertrand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbertrand/subscriptions","organizations_url":"https://api.github.com/users/mbertrand/orgs","repos_url":"https://api.github.com/users/mbertrand/repos","events_url":"https://api.github.com/users/mbertrand/events{/privacy}","received_events_url":"https://api.github.com/users/mbertrand/received_events","type":"User","site_admin":false},"body":"@mgrauer This should fix the issue you reported (https://github.com/Kitware/minerva/issues/121)\r\n\r\nSteps to reproduce issue:\r\n- Add a new WMS source\r\n- Add a dataset from the source\r\n- Add another WMS source\r\n- Add a dataset from the second WMS source","created_at":"2015-09-28T20:25:51Z","updated_at":"2015-09-29T14:39:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"39dd54451e7ae5008300dfd11ec3c87c8b1840a7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Kitware/minerva/pulls/127/commits","review_comments_url":"https://api.github.com/repos/Kitware/minerva/pulls/127/comments","review_comment_url":"https://api.github.com/repos/Kitware/minerva/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Kitware/minerva/issues/127/comments","statuses_url":"https://api.github.com/repos/Kitware/minerva/statuses/22d580d2ebdc7a7b86ba0e0ef860c7c9b1f6f4df","head":{"label":"mbertrand:issue121","ref":"issue121","sha":"22d580d2ebdc7a7b86ba0e0ef860c7c9b1f6f4df","user":{"login":"mbertrand","id":187676,"avatar_url":"https://avatars.githubusercontent.com/u/187676?v=3","gravatar_id":"","url":"https://api.github.com/users/mbertrand","html_url":"https://github.com/mbertrand","followers_url":"https://api.github.com/users/mbertrand/followers","following_url":"https://api.github.com/users/mbertrand/following{/other_user}","gists_url":"https://api.github.com/users/mbertrand/gists{/gist_id}","starred_url":"https://api.github.com/users/mbertrand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbertrand/subscriptions","organizations_url":"https://api.github.com/users/mbertrand/orgs","repos_url":"https://api.github.com/users/mbertrand/repos","events_url":"https://api.github.com/users/mbertrand/events{/privacy}","received_events_url":"https://api.github.com/users/mbertrand/received_events","type":"User","site_admin":false},"repo":{"id":43000402,"name":"minerva","full_name":"mbertrand/minerva","owner":{"login":"mbertrand","id":187676,"avatar_url":"https://avatars.githubusercontent.com/u/187676?v=3","gravatar_id":"","url":"https://api.github.com/users/mbertrand","html_url":"https://github.com/mbertrand","followers_url":"https://api.github.com/users/mbertrand/followers","following_url":"https://api.github.com/users/mbertrand/following{/other_user}","gists_url":"https://api.github.com/users/mbertrand/gists{/gist_id}","starred_url":"https://api.github.com/users/mbertrand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbertrand/subscriptions","organizations_url":"https://api.github.com/users/mbertrand/orgs","repos_url":"https://api.github.com/users/mbertrand/repos","events_url":"https://api.github.com/users/mbertrand/events{/privacy}","received_events_url":"https://api.github.com/users/mbertrand/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mbertrand/minerva","description":"Minerva: web application for geospatial analysis and visualization","fork":true,"url":"https://api.github.com/repos/mbertrand/minerva","forks_url":"https://api.github.com/repos/mbertrand/minerva/forks","keys_url":"https://api.github.com/repos/mbertrand/minerva/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mbertrand/minerva/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mbertrand/minerva/teams","hooks_url":"https://api.github.com/repos/mbertrand/minerva/hooks","issue_events_url":"https://api.github.com/repos/mbertrand/minerva/issues/events{/number}","events_url":"https://api.github.com/repos/mbertrand/minerva/events","assignees_url":"https://api.github.com/repos/mbertrand/minerva/assignees{/user}","branches_url":"https://api.github.com/repos/mbertrand/minerva/branches{/branch}","tags_url":"https://api.github.com/repos/mbertrand/minerva/tags","blobs_url":"https://api.github.com/repos/mbertrand/minerva/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mbertrand/minerva/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mbertrand/minerva/git/refs{/sha}","trees_url":"https://api.github.com/repos/mbertrand/minerva/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mbertrand/minerva/statuses/{sha}","languages_url":"https://api.github.com/repos/mbertrand/minerva/languages","stargazers_url":"https://api.github.com/repos/mbertrand/minerva/stargazers","contributors_url":"https://api.github.com/repos/mbertrand/minerva/contributors","subscribers_url":"https://api.github.com/repos/mbertrand/minerva/subscribers","subscription_url":"https://api.github.com/repos/mbertrand/minerva/subscription","commits_url":"https://api.github.com/repos/mbertrand/minerva/commits{/sha}","git_commits_url":"https://api.github.com/repos/mbertrand/minerva/git/commits{/sha}","comments_url":"https://api.github.com/repos/mbertrand/minerva/comments{/number}","issue_comment_url":"https://api.github.com/repos/mbertrand/minerva/issues/comments{/number}","contents_url":"https://api.github.com/repos/mbertrand/minerva/contents/{+path}","compare_url":"https://api.github.com/repos/mbertrand/minerva/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mbertrand/minerva/merges","archive_url":"https://api.github.com/repos/mbertrand/minerva/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mbertrand/minerva/downloads","issues_url":"https://api.github.com/repos/mbertrand/minerva/issues{/number}","pulls_url":"https://api.github.com/repos/mbertrand/minerva/pulls{/number}","milestones_url":"https://api.github.com/repos/mbertrand/minerva/milestones{/number}","notifications_url":"https://api.github.com/repos/mbertrand/minerva/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mbertrand/minerva/labels{/name}","releases_url":"https://api.github.com/repos/mbertrand/minerva/releases{/id}","created_at":"2015-09-23T12:47:09Z","updated_at":"2015-09-23T12:47:10Z","pushed_at":"2015-09-28T20:23:19Z","git_url":"git://github.com/mbertrand/minerva.git","ssh_url":"git@github.com:mbertrand/minerva.git","clone_url":"https://github.com/mbertrand/minerva.git","svn_url":"https://github.com/mbertrand/minerva","homepage":"","size":6180,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Kitware:master","ref":"master","sha":"6b03d516939d8614a9956c902b1b9e3a22d2c1c2","user":{"login":"Kitware","id":87549,"avatar_url":"https://avatars.githubusercontent.com/u/87549?v=3","gravatar_id":"","url":"https://api.github.com/users/Kitware","html_url":"https://github.com/Kitware","followers_url":"https://api.github.com/users/Kitware/followers","following_url":"https://api.github.com/users/Kitware/following{/other_user}","gists_url":"https://api.github.com/users/Kitware/gists{/gist_id}","starred_url":"https://api.github.com/users/Kitware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kitware/subscriptions","organizations_url":"https://api.github.com/users/Kitware/orgs","repos_url":"https://api.github.com/users/Kitware/repos","events_url":"https://api.github.com/users/Kitware/events{/privacy}","received_events_url":"https://api.github.com/users/Kitware/received_events","type":"Organization","site_admin":false},"repo":{"id":20766594,"name":"minerva","full_name":"Kitware/minerva","owner":{"login":"Kitware","id":87549,"avatar_url":"https://avatars.githubusercontent.com/u/87549?v=3","gravatar_id":"","url":"https://api.github.com/users/Kitware","html_url":"https://github.com/Kitware","followers_url":"https://api.github.com/users/Kitware/followers","following_url":"https://api.github.com/users/Kitware/following{/other_user}","gists_url":"https://api.github.com/users/Kitware/gists{/gist_id}","starred_url":"https://api.github.com/users/Kitware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kitware/subscriptions","organizations_url":"https://api.github.com/users/Kitware/orgs","repos_url":"https://api.github.com/users/Kitware/repos","events_url":"https://api.github.com/users/Kitware/events{/privacy}","received_events_url":"https://api.github.com/users/Kitware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Kitware/minerva","description":"Minerva: web application for geospatial analysis and visualization","fork":false,"url":"https://api.github.com/repos/Kitware/minerva","forks_url":"https://api.github.com/repos/Kitware/minerva/forks","keys_url":"https://api.github.com/repos/Kitware/minerva/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Kitware/minerva/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Kitware/minerva/teams","hooks_url":"https://api.github.com/repos/Kitware/minerva/hooks","issue_events_url":"https://api.github.com/repos/Kitware/minerva/issues/events{/number}","events_url":"https://api.github.com/repos/Kitware/minerva/events","assignees_url":"https://api.github.com/repos/Kitware/minerva/assignees{/user}","branches_url":"https://api.github.com/repos/Kitware/minerva/branches{/branch}","tags_url":"https://api.github.com/repos/Kitware/minerva/tags","blobs_url":"https://api.github.com/repos/Kitware/minerva/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Kitware/minerva/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Kitware/minerva/git/refs{/sha}","trees_url":"https://api.github.com/repos/Kitware/minerva/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Kitware/minerva/statuses/{sha}","languages_url":"https://api.github.com/repos/Kitware/minerva/languages","stargazers_url":"https://api.github.com/repos/Kitware/minerva/stargazers","contributors_url":"https://api.github.com/repos/Kitware/minerva/contributors","subscribers_url":"https://api.github.com/repos/Kitware/minerva/subscribers","subscription_url":"https://api.github.com/repos/Kitware/minerva/subscription","commits_url":"https://api.github.com/repos/Kitware/minerva/commits{/sha}","git_commits_url":"https://api.github.com/repos/Kitware/minerva/git/commits{/sha}","comments_url":"https://api.github.com/repos/Kitware/minerva/comments{/number}","issue_comment_url":"https://api.github.com/repos/Kitware/minerva/issues/comments{/number}","contents_url":"https://api.github.com/repos/Kitware/minerva/contents/{+path}","compare_url":"https://api.github.com/repos/Kitware/minerva/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Kitware/minerva/merges","archive_url":"https://api.github.com/repos/Kitware/minerva/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Kitware/minerva/downloads","issues_url":"https://api.github.com/repos/Kitware/minerva/issues{/number}","pulls_url":"https://api.github.com/repos/Kitware/minerva/pulls{/number}","milestones_url":"https://api.github.com/repos/Kitware/minerva/milestones{/number}","notifications_url":"https://api.github.com/repos/Kitware/minerva/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Kitware/minerva/labels{/name}","releases_url":"https://api.github.com/repos/Kitware/minerva/releases{/id}","created_at":"2014-06-12T12:31:22Z","updated_at":"2015-09-17T18:11:45Z","pushed_at":"2015-09-29T03:03:47Z","git_url":"git://github.com/Kitware/minerva.git","ssh_url":"git@github.com:Kitware/minerva.git","clone_url":"https://github.com/Kitware/minerva.git","svn_url":"https://github.com/Kitware/minerva","homepage":"","size":6180,"stargazers_count":5,"watchers_count":5,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6,"mirror_url":null,"open_issues_count":47,"forks":6,"open_issues":47,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Kitware/minerva/pulls/127"},"html":{"href":"https://github.com/Kitware/minerva/pull/127"},"issue":{"href":"https://api.github.com/repos/Kitware/minerva/issues/127"},"comments":{"href":"https://api.github.com/repos/Kitware/minerva/issues/127/comments"},"review_comments":{"href":"https://api.github.com/repos/Kitware/minerva/pulls/127/comments"},"review_comment":{"href":"https://api.github.com/repos/Kitware/minerva/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Kitware/minerva/pulls/127/commits"},"statuses":{"href":"https://api.github.com/repos/Kitware/minerva/statuses/22d580d2ebdc7a7b86ba0e0ef860c7c9b1f6f4df"}}}}