added clear canvas button back to topics view, including javascript code to back it up
This commit is contained in:
parent
e2c28da81e
commit
195889e6fe
3 changed files with 6 additions and 4 deletions
|
@ -164,9 +164,10 @@ function clearCanvasExceptRoot() {
|
||||||
ids.forEach(function(id, index) {
|
ids.forEach(function(id, index) {
|
||||||
if (id != root.id) {
|
if (id != root.id) {
|
||||||
Mconsole.graph.removeNode(id);
|
Mconsole.graph.removeNode(id);
|
||||||
//OK I feel bad about this, but not too bad
|
//don't use disposeLabel or they'll never come back!
|
||||||
//TODO: this leaves labels hidden on the map
|
//maybe there's a better way that recreates the labels later??
|
||||||
Mconsole.labels.hideLabel(id);
|
Mconsole.labels.hideLabel(id);
|
||||||
|
$('#topic_' + id + '_label').hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
fetchRelatives(root); //also runs Mconsole.plot()
|
fetchRelatives(root); //also runs Mconsole.plot()
|
||||||
|
|
|
@ -507,6 +507,7 @@ function onPlaceLabelHandler(domElement, node) {
|
||||||
style.top = (top-165) + 'px';
|
style.top = (top-165) + 'px';
|
||||||
style.display = '';
|
style.display = '';
|
||||||
var label = document.getElementById('topic_' + node.id + '_label');
|
var label = document.getElementById('topic_' + node.id + '_label');
|
||||||
|
$(label).show();
|
||||||
w = label.offsetWidth;
|
w = label.offsetWidth;
|
||||||
style = label.style;
|
style = label.style;
|
||||||
style.left = (-(w / 2 + 106)) + 'px';
|
style.left = (-(w / 2 + 106)) + 'px';
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
# map recenters on a new topic, it's like you're on that topic's page.
|
# 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
|
# Nice, but the URL and being unable to remove the root node still hamper that
|
||||||
# experience.
|
# experience.
|
||||||
# TODO: What URL accesses this view?
|
# URL: /topics/<topicid>
|
||||||
#
|
#
|
||||||
#%>
|
#%>
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
<% if authenticated? %>
|
<% if authenticated? %>
|
||||||
<button onclick="saveToMap();">Save to Map</button>
|
<button onclick="saveToMap();">Save to Map</button>
|
||||||
<% end %>
|
<% end %>
|
||||||
<!-- <button onclick='clearCanvasExceptRoot();'>Clear Canvas</button> -->
|
<button onclick='clearCanvasExceptRoot();'>Clear Canvas</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="clearfloat"></div>
|
<div class="clearfloat"></div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue