From 12e4c1e88c976670d1c72ca0a13bac58a74a07be Mon Sep 17 00:00:00 2001 From: hppeng Date: Thu, 23 Jun 2022 03:16:36 -0700 Subject: [PATCH] Revert to current dev branch behaviour somewhat --- js/builder.js | 2 +- js/builder_graph.js | 1 - js/computation_graph.js | 8 ++++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/js/builder.js b/js/builder.js index f497224..96513d8 100644 --- a/js/builder.js +++ b/js/builder.js @@ -293,7 +293,7 @@ function init_autocomplete() { resultsList: { maxResults: 1000, tabSelect: true, - noResults: true, + noResults: false, class: "search-box dark-7 rounded-bottom px-2 fw-bold dark-shadow-sm", element: (list, data) => { // dynamic result loc diff --git a/js/builder_graph.js b/js/builder_graph.js index cfb8491..51a4d6c 100644 --- a/js/builder_graph.js +++ b/js/builder_graph.js @@ -894,7 +894,6 @@ class SkillPointSetterNode extends ComputeNode { } compute_func(input_map) { - console.log("a"); if (input_map.size !== 1) { throw "SkillPointSetterNode accepts exactly one input (build)"; } const [build] = input_map.values(); // Extract values, pattern match it into size one list and bind to first element for (const [idx, elem] of skp_order.entries()) { diff --git a/js/computation_graph.js b/js/computation_graph.js index c0337ec..90fe08c 100644 --- a/js/computation_graph.js +++ b/js/computation_graph.js @@ -105,7 +105,7 @@ class ComputeNode { * * @param node : ComputeNode to schedule an update for. */ -function calcSchedule(node) { +function calcSchedule(node, timeout) { if (node.update_task !== null) { clearTimeout(node.update_task); } @@ -113,7 +113,7 @@ function calcSchedule(node) { node.update_task = setTimeout(function() { node.update(); node.update_task = null; - }, 500); + }, timeout); } class PrintNode extends ComputeNode { @@ -139,8 +139,8 @@ class InputNode extends ComputeNode { constructor(name, input_field) { super(name); this.input_field = input_field; - //this.input_field.addEventListener("input", () => calcSchedule(this)); - this.input_field.addEventListener("change", () => calcSchedule(this)); + this.input_field.addEventListener("input", () => calcSchedule(this, 5000)); + this.input_field.addEventListener("change", () => calcSchedule(this, 500)); //calcSchedule(this); Manually fire first update for better control }