From 5cbea591609e4afcc39c0721f9fa596b5db0658d Mon Sep 17 00:00:00 2001 From: Daniel <daniel@harvey> Date: Tue, 17 Dec 2019 13:59:09 +0100 Subject: [PATCH] FIX: Handling multiple highlighters on one page. --- src/core/js/query_shortcuts.js | 2 +- src/core/js/tour.js | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/core/js/query_shortcuts.js b/src/core/js/query_shortcuts.js index 1b4765ce..c12e2b47 100644 --- a/src/core/js/query_shortcuts.js +++ b/src/core/js/query_shortcuts.js @@ -38,7 +38,7 @@ * [ * { * "description": "Find all geological data sets with temperature above {temp} K.", - * "query": "FIND Record Geodata with temperature > \"$1\"" + * "query": "FIND Record Geodata with temperature > \"{temp}\"" * }, { * ... * } diff --git a/src/core/js/tour.js b/src/core/js/tour.js index 9e4be98a..0becc006 100644 --- a/src/core/js/tour.js +++ b/src/core/js/tour.js @@ -565,17 +565,18 @@ var tour = new function() { return; } const ids = Object.keys(highlighters) + var highlightable = {} for (const id of ids) { - var highlightable = $(highlighters[id]); + highlightable[id] = $(highlighters[id]); if (id == "button") { // special case, don't look for the highlighter in the content - this._apply_highlighter(button, highlightable); + this._apply_highlighter(button, highlightable[id]); } else { $(button).on('shown.bs.popover', (e) => { console.log("Highlighting:") console.log(highlighters[id]); - console.log(highlightable); - this._apply_highlighter("#" + id, highlightable); + console.log(highlightable[id]); + this._apply_highlighter("#" + id, highlightable[id]); }); } } -- GitLab