I am seeking assistance in modifying the following files:
- red.min.js located at: ~ npm\node_modules\node-red\node_modules@node-red\editor-client\public\red
- style.min.css located at: ~ npm\node_modules\node-red\node_modules@node-red\editor-client\public\red
Unfortunately, I have been unable to find any information or documentation regarding the functions and styles of the Node-Red editor. My main objective is to enable the node palette sidebar to be resizable as shown in the image example:
https://i.sstatic.net/emrNr.png
I have considered reusing a portion of the code used for:
<div id = "red-ui-sidebar">
I welcome any ideas and thank you for taking the time to read this.
Additional notes: To install Node-Red, run the following command:
npm install -g --unsafe-perm node-red
Update 13/12/2020
Events Added:
- Added
RED.events.on("palette:resize", workspace_tabs.resize);
- Added
RED.events.on("palette:resize", resizeNavBorder);
- Added
RED.events.on("palette:resize", resizeStack);
- Added
RED.events.on("palette:resize", handleWindowResize);
HTML Additions:
- Added
in foo buildEditor'<div id="red-ui-palette-separator"></div>' +
CSS Additions:
- Added
#red-ui-palette-separator {position: absolute; top: 0px; left: 189px; bottom: 0px; width: 7px; z-index: 11; background: #f3f3f3 url(images/grip.png) no-repeat 50% 50%; cursor: col-resize; border-color: #bbb; box-sizing: border-box; border: 1px solid #bbb; }
- Added
.red-ui-palette-closed > #red-ui-palette-separator {left: 0px !important;}
- Added
z-index: 12;
to .red-ui-sidebar-control-left - Added
left: 189px;
to #red-ui-workspace - Added
to #red-ui-sidebar-separatorborder-color: #bbb; box-sizing: border-box;
JavaScript Additions:
(to foo init inside palette prop of RED)
- Added
var paletteSeparator = {}; paletteSeparator.dragging = false;
- Added
setupPaletteSeparator();
- Added
RED.popover.tooltip($("#red-ui-palette-separator").find(".red-ui-palette-control-left"), RED._("keyboard.togglePalette"), "core:toggle-palette");
What's Working:
- The palette separator displays correctly and maintains its styles
- The palette separator toggles on and off in the correct position
- The palette toggle button is positioned above the palette separator for ease of use
- The palette separator can now be dragged and remembers its last position when toggled on and off
What I Need Help With:
- Creating events to handle Palette resizing upon start
- Resizing the Palette and Workspace during drag event
- Updating the resized Palette and Workspace upon stop event
Any assistance would be greatly appreciated.
function setupPaletteSeparator() {
$("#red-ui-palette-separator").draggable({
axis: "x",
start: function (event, ui) {
},
drag: function (event, ui) {
},
stop: function (event, ui) {
},
});
}