From 494f562b3b25f96ed5a1c6708091586a00e09621 Mon Sep 17 00:00:00 2001 From: themancalledjakob Date: Fri, 13 Oct 2023 17:11:40 +0200 Subject: [PATCH] prevent dummy breaking things --- bin/web/js/layer.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/web/js/layer.js b/bin/web/js/layer.js index 4ccb295..f36d116 100644 --- a/bin/web/js/layer.js +++ b/bin/web/js/layer.js @@ -463,11 +463,14 @@ const Layer = function(tp, layerID, fontsAndAxes, autoInit = true) { const panelProp= tp.getPanelPropTitle(propName); const panelPropMom = tp.getPanelPropContainer(panelProp); const newValue = active ? getArtboard().theatreObject.value.width : 0; + const textWrappingButton = tp.getPanel().querySelector('.textWrappingButton'); + + if (panelPropMom !== null && textWrappingButton !== null) { if (active) { panelPropMom.style.display = 'flex'; - tp.getPanel().querySelector('.textWrappingButton').classList.add('active'); + textWrappingButton.classList.add('active'); } else { - tp.getPanel().querySelector('.textWrappingButton').classList.remove('active'); + textWrappingButton.classList.remove('active'); panelPropMom.style.display = 'none'; } @@ -478,6 +481,7 @@ const Layer = function(tp, layerID, fontsAndAxes, autoInit = true) { set(this.theatreObject.props[propName], newValue); }); } + } } };