diff --git a/graph.js b/graph.js
index 598b8c7..4fddcad 100644
--- a/graph.js
+++ b/graph.js
@@ -69,15 +69,15 @@ const BUTTON_ROWS = [
["forum", "issue tracker", "chat", "email"]
];
-function urlButton(type, url) {
+function urlButton(type, url, btnClass) {
const button = document.createElement("button");
let iconFile = BUTTON_ICONS[type];
button.type = "button"
- button.classList.add('btn', 'btn-sm', 'm-1');
+ button.classList.add('btn', 'm-1');
let icon = `
`;
button.innerHTML = icon + " " + type;
if (url !== undefined) {
- button.classList.add('btn-info');
+ button.classList.add(btnClass);
button.onclick = function() {
window.open(url, "_blank");
}
@@ -92,6 +92,14 @@ function highlightNode(node) {
if (node.id() == "simulators") {
return;
}
+ // Swap out center/uncenter buttons
+ const centerButton = document.getElementById("center_button");
+ const uncenterButton = document.getElementById("uncenter_button");
+ if (centerButton) {
+ centerButton.classList.add("d-none");
+ uncenterButton.classList.remove("d-none");
+ }
+
// Ignore the meta node
meta_node.deselect();
meta_node.remove();
@@ -185,7 +193,7 @@ function highlightElement(event) {
// Only unhilight node if double tapped on background
// Single tap is too error prone
if (event.type === "dbltap") {
- unhighlightNode(null);
+ unhighlightNode(null, true);
}
else {
console.log("No-op: single tap on background");
@@ -212,7 +220,15 @@ function highlightElement(event) {
}
}
-function unhighlightNode(event) {
+function unhighlightNode(event, unselect) {
+ // Swap out center/uncenter buttons
+ const centerButton = document.getElementById("center_button");
+ const uncenterButton = document.getElementById("uncenter_button");
+ if (centerButton) {
+ centerButton.classList.remove("d-none");
+ uncenterButton.classList.add("d-none");
+ }
+
// Ignore the meta node
meta_node.restore();
meta_node_edges.restore();
@@ -245,7 +261,9 @@ function unhighlightNode(event) {
};
return_graph_to_init();
- showDetails(null, null);
+ if (unselect) {
+ showDetails(null, null);
+ }
}
function updateHighlights() {
diff --git a/index.html b/index.html
index e86e074..4ab7fd3 100644
--- a/index.html
+++ b/index.html
@@ -69,7 +69,7 @@
Highlight simulators
diff --git a/index.js b/index.js
index 36a92ec..b9fcc72 100644
--- a/index.js
+++ b/index.js
@@ -42,19 +42,26 @@ function showDetails(data, connected) {
let description = document.createElement("div");
if (data["features"].includes("simulator")) {
const quoted_sim = `[id='${data.id}']`;
- description.innerHTML = `
+ description.innerHTML = `
${data["full_name"]}
-