diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/group.js b/packages/node_modules/@node-red/editor-client/src/js/ui/group.js index ffce9f179..9dbd9c19b 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/group.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/group.js @@ -83,7 +83,8 @@ RED.group = (function() { } var defaultGroupStyle = { - label: true + label: true, + "label-position": "nw" }; var groupDef = { @@ -97,7 +98,7 @@ RED.group = (function() { var style = this.style || {}; RED.colorPicker.create({ id:"node-input-style-stroke", - value: style.stroke || "#a4a4a4", + value: style.stroke || defaultGroupStyle.stroke || "#a4a4a4", palette: colorPalette, cellPerRow: colorCount, cellWidth: 16, @@ -125,7 +126,7 @@ RED.group = (function() { RED.colorPicker.create({ id:"node-input-style-color", - value: style.color || "#a4a4a4", + value: style.color || defaultGroupStyle.color ||"#a4a4a4", palette: colorPalette, cellPerRow: colorCount, cellWidth: 16, @@ -167,6 +168,13 @@ RED.group = (function() { if (this.style["fill-opacity"] === "1") { delete this.style["fill-opacity"] } + var node = this; + ['stroke','fill','stroke-opacity','fill-opacity','color','label-position'].forEach(function(prop) { + if (node.style[prop] === defaultGroupStyle[prop]) { + delete node.style[prop] + } + }) + this.resize = true; }, set:{ @@ -219,9 +227,17 @@ RED.group = (function() { "stroke-opacity": groupStyle.strokeOpacity, fill: convertColorToHex(groupStyle.fill), "fill-opacity": groupStyle.fillOpacity, - label: true + label: true, + "label-position": "nw" } groupStyleDiv.remove(); + groupStyleDiv = $("