Initial context sidebar tab

This commit is contained in:
Nick O'Leary 2018-06-21 10:31:27 +01:00
parent 73a18891c5
commit 8d6ac6406d
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
5 changed files with 49 additions and 1 deletions

View File

@ -149,6 +149,7 @@ module.exports = function(grunt) {
"editor/js/ui/palette.js",
"editor/js/ui/tab-info.js",
"editor/js/ui/tab-config.js",
"editor/js/ui/tab-context.js",
"editor/js/ui/palette-editor.js",
"editor/js/ui/editor.js",
"editor/js/ui/tray.js",

View File

@ -10,6 +10,7 @@
"ctrl-g i": "core:show-info-tab",
"ctrl-g d": "core:show-debug-tab",
"ctrl-g c": "core:show-config-tab",
"ctrl-g x": "core:show-context-tab",
"ctrl-e": "core:show-export-dialog",
"ctrl-i": "core:show-import-dialog",
"ctrl-space": "core:toggle-sidebar",

View File

@ -61,7 +61,7 @@ RED.sidebar = (function() {
}
delete options.closeable;
options.wrapper = $('<div>',{style:"height:100%"}).appendTo("#sidebar-content")
options.wrapper.append(options.content);
options.wrapper.hide();
@ -218,6 +218,7 @@ RED.sidebar = (function() {
showSidebar();
RED.sidebar.info.init();
RED.sidebar.config.init();
RED.sidebar.context.init();
// hide info bar at start if screen rather narrow...
if ($(window).width() < 600) { RED.menu.setSelected("menu-item-sidebar",false); }
}

View File

@ -0,0 +1,41 @@
/**
* Copyright JS Foundation and other contributors, http://js.foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
RED.sidebar.context = (function() {
var content;
function init() {
content = document.createElement("div");
content.className = "sidebar-node-info"
RED.actions.add("core:show-context-tab",show);
RED.sidebar.addTab({
id: "context",
label: RED._("sidebar.context.label"),
name: RED._("sidebar.context.name"),
iconClass: "fa fa-database",
content: content,
pinned: false,
enableOnEdit: false
});
}
function show() {
RED.sidebar.show("context");
}
return {
init: init
}
})();

View File

@ -459,6 +459,10 @@
"filterAll":"all",
"filtered": "__count__ hidden"
},
"context": {
"name":"Context",
"label":"context"
},
"palette": {
"name": "Palette management",
"label": "palette"