mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Initial context sidebar tab
This commit is contained in:
		| @@ -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", | ||||
|   | ||||
| @@ -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", | ||||
|   | ||||
| @@ -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); } | ||||
|     } | ||||
|   | ||||
							
								
								
									
										41
									
								
								editor/js/ui/tab-context.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								editor/js/ui/tab-context.js
									
									
									
									
									
										Normal 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 | ||||
|     } | ||||
| })(); | ||||
| @@ -459,6 +459,10 @@ | ||||
|             "filterAll":"all", | ||||
|             "filtered": "__count__ hidden" | ||||
|         }, | ||||
|         "context": { | ||||
|             "name":"Context", | ||||
|             "label":"context" | ||||
|         }, | ||||
|         "palette": { | ||||
|             "name": "Palette management", | ||||
|             "label": "palette" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user