From 379240033509eb4efd37144c8edf727363876acf Mon Sep 17 00:00:00 2001 From: Ryan Blenis Date: Sun, 15 Dec 2019 05:20:44 -0500 Subject: [PATCH] - Clear plugin headers / pages on device change - Safety check existence of plugin on device change - Add plugin eventing capability --- views/default.handlebars | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/views/default.handlebars b/views/default.handlebars index 64b66b3d..9e378605 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -2371,6 +2371,11 @@ pluginHandler.refreshPluginHandler(); break; } + case 'plugin': { + if (pluginHandler == null) break; + try { pluginHandler[message.event.plugin][message.event.pluginaction](message); } catch (e) { console.log("PluginHandler could not event message: ", e); } + break; + } default: //console.log('Unknown message.event.action', message.event.action); break; @@ -4610,9 +4615,10 @@ // Device refresh plugin handler if (pluginHandler != null) { + QH('p19headers', ''); QH('p19pages', ''); pluginHandler.callHook('onDeviceRefreshEnd', nodeid, panel, refresh, event); var lastTab = getstore('_curPluginPage', null); - if (lastTab != null) pluginHandler.callPluginPage(lastTab, Q('p19ph-' + lastTab)); + if (lastTab != null && Q('p19ph-' + lastTab) != null) pluginHandler.callPluginPage(lastTab, Q('p19ph-' + lastTab)); } } setupDesktop(); // Always refresh the desktop, even if we are on the same device, we need to do some canvas switching.