Merge pull request #722 from ryanblenis/plugin-admin
Remember the last plugin tab and jump back to it.
This commit is contained in:
commit
e6ea3d4edd
|
@ -97,7 +97,7 @@ module.exports.pluginHandler = function (parent) {
|
|||
if (!Q(d.tabId)) {
|
||||
var defaultOn = 'class="on"';
|
||||
if (Q('p19headers').querySelectorAll("span.on").length) defaultOn = '';
|
||||
QA('p19headers', '<span ' + defaultOn + ' onclick="return pluginHandler.callPluginPage(\\''+d.tabId+'\\', this);">'+d.tabTitle+'</span>');
|
||||
QA('p19headers', '<span ' + defaultOn + ' id="p19ph-' + d.tabId + '" onclick="return pluginHandler.callPluginPage(\\''+d.tabId+'\\', this);">'+d.tabTitle+'</span>');
|
||||
QA('p19pages', '<div id="' + d.tabId + '"></div>');
|
||||
}
|
||||
QV('MainDevPlugins', true);
|
||||
|
@ -109,6 +109,7 @@ module.exports.pluginHandler = function (parent) {
|
|||
var tabs = Q('p19headers').querySelectorAll("span");
|
||||
for (const i of tabs) { i.classList.remove('on'); }
|
||||
el.classList.add('on');
|
||||
putstore('_curPluginPage', id);
|
||||
};
|
||||
obj.addPluginEx = function() {
|
||||
meshserver.send({ action: 'addplugin', url: Q('pluginurlinput').value});
|
||||
|
|
|
@ -4581,7 +4581,11 @@
|
|||
p13clearConsoleMsg();
|
||||
|
||||
// Device refresh plugin handler
|
||||
if (pluginHandler != null) { pluginHandler.callHook('onDeviceRefreshEnd', nodeid, panel, refresh, event); }
|
||||
if (pluginHandler != null) {
|
||||
pluginHandler.callHook('onDeviceRefreshEnd', nodeid, panel, refresh, event);
|
||||
var lastTab = getstore('_curPluginPage', null);
|
||||
if (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.
|
||||
if (!panel) panel = 10;
|
||||
|
|
Loading…
Reference in New Issue