From dc91568b2303fb918e43638db317d0892035a493 Mon Sep 17 00:00:00 2001 From: Wayne Myers Date: Tue, 13 Apr 2021 23:02:13 +0100 Subject: [PATCH] Allow JSON specified hotspot function handlers Fixes issue mentioned here: https://github.com/mpetroff/pannellum/issues/252#issuecomment-281464915 --- src/standalone/standalone.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/standalone/standalone.js b/src/standalone/standalone.js index e883bb4..d6c7c46 100644 --- a/src/standalone/standalone.js +++ b/src/standalone/standalone.js @@ -77,6 +77,18 @@ function parseURLParameters() { if (configFromURL.hasOwnProperty(key)) { continue; } + + // Handle function handlers in hotspots +                if(key === "hotSpots") { +                  responseMap[key].forEach((arr) => { +                    for (var hkey in arr) { +                      if(hkey.endsWith("Func")) { +                        arr[hkey] = window[arr[hkey]]; +                      } +                    } +                  }); +                } + configFromURL[key] = responseMap[key]; }