1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Tidy sidebar menu

- remove inconsistent ellipsis
- add Subflow submenu
This commit is contained in:
Nick O'Leary 2015-01-17 20:36:18 +00:00
parent 8d5f99640e
commit d8c7ea8144

View File

@ -16,9 +16,9 @@
var RED = (function() { var RED = (function() {
var deploymentTypes = { var deploymentTypes = {
"full":{label:"Deploy",img:"images/deploy-full-o.png"}, "full":{img:"images/deploy-full-o.png"},
"nodes":{label:"Deploy modified nodes",img:"images/deploy-nodes-o.png"}, "nodes":{img:"images/deploy-nodes-o.png"},
"flows":{label:"Deploy modified flows",img:"images/deploy-flows-o.png"} "flows":{img:"images/deploy-flows-o.png"}
} }
var deploymentType = "full"; var deploymentType = "full";
@ -295,38 +295,39 @@ var RED = (function() {
function changeDeploymentType(type) { function changeDeploymentType(type) {
deploymentType = type; deploymentType = type;
$("#btn-deploy img").attr("src",deploymentTypes[type].img); $("#btn-deploy img").attr("src",deploymentTypes[type].img);
//$("#btn-deploy span").text(deploymentTypes[type].label);
} }
$(function() { $(function() {
RED.menu.init({id:"btn-sidemenu", RED.menu.init({id:"btn-sidemenu",
options: [ options: [
{id:"btn-sidebar",_icon:"fa fa-columns",label:"Sidebar",toggle:true,onselect:RED.sidebar.toggleSidebar, selected: true}, {id:"btn-sidebar",label:"Sidebar",toggle:true,onselect:RED.sidebar.toggleSidebar, selected: true},
{id:"btn-node-status",_icon:"fa fa-info",label:"Node Status",toggle:true,onselect:toggleStatus}, {id:"btn-node-status",label:"Node Status",toggle:true,onselect:toggleStatus},
null, null,
{id:"btn-import-menu",_icon:"fa fa-sign-in",label:"Import...",options:[ {id:"btn-import-menu",label:"Import",options:[
{id:"btn-import-clipboard",_icon:"fa fa-clipboard",label:"Clipboard...",onselect:RED.view.showImportNodesDialog}, {id:"btn-import-clipboard",label:"Clipboard",onselect:RED.view.showImportNodesDialog},
{id:"btn-import-library",_icon:"fa fa-book",label:"Library",options:[]} {id:"btn-import-library",label:"Library",options:[]}
]}, ]},
{id:"btn-export-menu",_icon:"fa fa-sign-out",label:"Export...",disabled:true,options:[ {id:"btn-export-menu",label:"Export",disabled:true,options:[
{id:"btn-export-clipboard",_icon:"fa fa-clipboard",label:"Clipboard...",disabled:true,onselect:RED.view.showExportNodesDialog}, {id:"btn-export-clipboard",label:"Clipboard",disabled:true,onselect:RED.view.showExportNodesDialog},
{id:"btn-export-library",_icon:"fa fa-book",label:"Library...",disabled:true,onselect:RED.view.showExportNodesLibraryDialog} {id:"btn-export-library",label:"Library",disabled:true,onselect:RED.view.showExportNodesLibraryDialog}
]}, ]},
null, null,
{id:"btn-config-nodes",_icon:"fa fa-th-list",label:"Configuration nodes...",onselect:RED.sidebar.config.show}, {id:"btn-config-nodes",label:"Configuration nodes",onselect:RED.sidebar.config.show},
null, null,
{id:"btn-create-subflow",_icon:"fa fa-share-alt",label:"Create subflow",onselect:RED.view.createSubflow}, {id:"btn-subflow-menu",label:"Subflows", options: [
{id:"btn-convert-subflow",_icon:"fa fa-share-alt",label:"Convert to subflow",disabled:true,onselect:RED.view.convertToSubflow}, {id:"btn-create-subflow",label:"Create subflow",onselect:RED.view.createSubflow},
{id:"btn-convert-subflow",label:"Selection to subflow",disabled:true,onselect:RED.view.convertToSubflow},
]},
null, null,
{id:"btn-workspace-menu",_icon:"fa fa-th-large",label:"Workspaces",options:[ {id:"btn-workspace-menu",label:"Workspaces",options:[
{id:"btn-workspace-add",_icon:"fa fa-plus",label:"Add"}, {id:"btn-workspace-add",label:"Add"},
{id:"btn-workspace-edit",_icon:"fa fa-pencil",label:"Rename"}, {id:"btn-workspace-edit",label:"Rename"},
{id:"btn-workspace-delete",_icon:"fa fa-minus",label:"Delete"}, {id:"btn-workspace-delete",label:"Delete"},
null null
]}, ]},
null, null,
{id:"btn-keyboard-shortcuts",_icon:"fa fa-keyboard-o",label:"Keyboard Shortcuts",onselect:showHelp}, {id:"btn-keyboard-shortcuts",label:"Keyboard Shortcuts",onselect:showHelp},
{id:"btn-help",_icon:"fa fa-question",label:"Help...", href:"http://nodered.org/docs"} {id:"btn-help",label:"Help", href:"http://nodered.org/docs"}
] ]
}); });