Add sidebar menu and migrate existing panels to new api

This commit is contained in:
Nick O'Leary
2015-07-03 10:07:40 +01:00
parent 6cfa4976fe
commit 6359b90352
9 changed files with 139 additions and 63 deletions

View File

@@ -27,17 +27,23 @@ RED.sidebar.info = (function() {
});
var content = document.createElement("div");
content.id = "tab-info";
content.style.paddingTop = "4px";
content.style.paddingLeft = "4px";
content.style.paddingRight = "4px";
var propertiesExpanded = false;
function init() {
RED.sidebar.addTab({
id: "info",
label: RED._("sidebar.info.label"),
name: RED._("sidebar.info.name"),
content: content
});
}
function show() {
if (!RED.sidebar.containsTab("info")) {
RED.sidebar.addTab(RED._("sidebar.info.title"),content,false);
}
RED.sidebar.show("info");
}
@@ -184,6 +190,7 @@ RED.sidebar.info = (function() {
});
return {
init: init,
show: show,
refresh:refresh,
clear: clear