From 998b37abc8e25e120afadae16924fe37beb257b1 Mon Sep 17 00:00:00 2001 From: Martin Stamm Date: Tue, 23 Apr 2024 13:27:03 +0200 Subject: [PATCH] revert: remove background for non-resizable textboxes This commit reverts 3e487b4b6b600095a9b3aee17e480f4c1fb5fe59 --- lib/TextBox.js | 7 ++----- test/DirectEditingSpec.js | 4 ---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/TextBox.js b/lib/TextBox.js index 2ea520b..1364856 100644 --- a/lib/TextBox.js +++ b/lib/TextBox.js @@ -120,8 +120,10 @@ TextBox.prototype.create = function(bounds, style, value, options) { minHeight: bounds.minHeight + 'px', left: bounds.x + 'px', top: bounds.y + 'px', + backgroundColor: '#ffffff', position: 'absolute', overflow: 'visible', + border: '1px solid #ccc', boxSizing: 'border-box', wordWrap: 'normal', textAlign: 'center', @@ -166,11 +168,6 @@ TextBox.prototype.create = function(bounds, style, value, options) { } if (options.resizable) { - assign(parent.style, { - backgroundColor: '#ffffff', - border: '1px solid #ccc' - }); - this.resizable(style); } diff --git a/test/DirectEditingSpec.js b/test/DirectEditingSpec.js index 1e118bc..469eaf4 100644 --- a/test/DirectEditingSpec.js +++ b/test/DirectEditingSpec.js @@ -551,10 +551,8 @@ describe('diagram-js-direct-editing', function() { // then var resizeHandle = directEditing._textbox.parent.getElementsByClassName('djs-direct-editing-resize-handle')[0]; - var parent = directEditing._textbox.parent; expect(resizeHandle).to.exist; - expect(parent.getAttribute('style').indexOf('background-color:')).not.to.eql(-1); })); @@ -573,10 +571,8 @@ describe('diagram-js-direct-editing', function() { // then var resizeHandle = directEditing._textbox.parent.getElementsByClassName('djs-direct-editing-resize-handle')[0]; - var parent = directEditing._textbox.parent; expect(resizeHandle).not.to.exist; - expect(parent.getAttribute('style').indexOf('background-color:')).to.eql(-1); }));