From 195889e6fe3d314cf669abfb5ee8d71113f80e35 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Fri, 22 Feb 2013 18:01:15 -0500 Subject: [PATCH] added clear canvas button back to topics view, including javascript code to back it up --- app/assets/javascripts/Jit/find.js | 5 +++-- app/assets/javascripts/Jit/graphsettings.js | 1 + app/views/topics/show.html.erb | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/Jit/find.js b/app/assets/javascripts/Jit/find.js index bde6c8e9..346ebf8e 100644 --- a/app/assets/javascripts/Jit/find.js +++ b/app/assets/javascripts/Jit/find.js @@ -164,9 +164,10 @@ function clearCanvasExceptRoot() { ids.forEach(function(id, index) { if (id != root.id) { Mconsole.graph.removeNode(id); - //OK I feel bad about this, but not too bad - //TODO: this leaves labels hidden on the map + //don't use disposeLabel or they'll never come back! + //maybe there's a better way that recreates the labels later?? Mconsole.labels.hideLabel(id); + $('#topic_' + id + '_label').hide(); } }); fetchRelatives(root); //also runs Mconsole.plot() diff --git a/app/assets/javascripts/Jit/graphsettings.js b/app/assets/javascripts/Jit/graphsettings.js index 50a34da3..4d8eef7c 100644 --- a/app/assets/javascripts/Jit/graphsettings.js +++ b/app/assets/javascripts/Jit/graphsettings.js @@ -507,6 +507,7 @@ function onPlaceLabelHandler(domElement, node) { style.top = (top-165) + 'px'; style.display = ''; var label = document.getElementById('topic_' + node.id + '_label'); + $(label).show(); w = label.offsetWidth; style = label.style; style.left = (-(w / 2 + 106)) + 'px'; diff --git a/app/views/topics/show.html.erb b/app/views/topics/show.html.erb index 71365977..c48bcc46 100644 --- a/app/views/topics/show.html.erb +++ b/app/views/topics/show.html.erb @@ -10,7 +10,7 @@ # map recenters on a new topic, it's like you're on that topic's page. # Nice, but the URL and being unable to remove the root node still hamper that # experience. - # TODO: What URL accesses this view? + # URL: /topics/ # #%> @@ -18,7 +18,7 @@ <% if authenticated? %> <% end %> - +