From be9521f659569da81f7634411ee71d33baa32708 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Fri, 14 May 2021 21:17:47 +0100 Subject: [PATCH] Revert some of #2967 to fix treeList gutter width calculation --- .../@node-red/editor-client/src/js/ui/common/treeList.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js b/packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js index 7f7eba1ba..6619ad76e 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js @@ -312,7 +312,8 @@ } if (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)); child.treeList.labelPadding.width(labelPaddingWidth+'px'); if (child.element) { $(child.element).css({ @@ -531,7 +532,8 @@ }).appendTo(label) } - var labelPaddingWidth = (item.gutter ? item.gutter[0].offsetWidth + 2 : 0) + (depth * 20) + var labelPaddingWidth = (item.gutter?item.gutter.width()+2:0)+(depth*20); + // var labelPaddingWidth = (item.gutter ? item.gutter[0].offsetWidth + 2 : 0) + (depth * 20) item.treeList.labelPadding = $('').css({ display: "inline-block", width: labelPaddingWidth+'px'