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

Fix treeList gutter calculation to handle floating gutters

Fixes #3234
This commit is contained in:
Nick O'Leary 2021-10-28 10:44:50 +01:00
parent e6de52eede
commit 84a237d3f5
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 5 additions and 4 deletions

View File

@ -340,7 +340,7 @@
if (child.depth !== parent.depth+1) { if (child.depth !== parent.depth+1) {
child.depth = parent.depth+1; child.depth = parent.depth+1;
// var labelPaddingWidth = ((child.gutter ? child.gutter[0].offsetWidth + 2 : 0) + (child.depth * 20)); // var labelPaddingWidth = ((child.gutter ? child.gutter[0].offsetWidth + 2 : 0) + (child.depth * 20));
var labelPaddingWidth = ((child.gutter?child.gutter.width()+2:0)+(child.depth*20)); var labelPaddingWidth = (((child.gutter&&!child.gutter.hasClass("red-ui-treeList-gutter-float"))?child.gutter.width()+2:0)+(child.depth*20));
child.treeList.labelPadding.width(labelPaddingWidth+'px'); child.treeList.labelPadding.width(labelPaddingWidth+'px');
if (child.element) { if (child.element) {
$(child.element).css({ $(child.element).css({
@ -562,8 +562,9 @@
}).appendTo(label) }).appendTo(label)
} }
// var labelPaddingWidth = (item.gutter?item.gutter.width()+2:0)+(depth*20);
var labelPaddingWidth = (item.gutter ? item.gutter[0].offsetWidth + 2 : 0) + (depth * 20) var labelPaddingWidth = ((item.gutter&&!item.gutter.hasClass("red-ui-treeList-gutter-float"))?item.gutter.width()+2:0)+(depth*20);
item.treeList.labelPadding = $('<span>').css({ item.treeList.labelPadding = $('<span>').css({
display: "inline-block", display: "inline-block",
"flex-shrink": 0, "flex-shrink": 0,

View File

@ -563,7 +563,7 @@ RED.sidebar.info.outliner = (function() {
} }
} }
function getGutter(n) { function getGutter(n) {
var span = $("<span>",{class:"red-ui-info-outline-gutter"}); var span = $("<span>",{class:"red-ui-info-outline-gutter red-ui-treeList-gutter-float"});
var revealButton = $('<button type="button" class="red-ui-info-outline-item-control-reveal red-ui-button red-ui-button-small"><i class="fa fa-search"></i></button>').appendTo(span).on("click",function(evt) { var revealButton = $('<button type="button" class="red-ui-info-outline-item-control-reveal red-ui-button red-ui-button-small"><i class="fa fa-search"></i></button>').appendTo(span).on("click",function(evt) {
evt.preventDefault(); evt.preventDefault();
evt.stopPropagation(); evt.stopPropagation();