mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Support color reset to the default in subflow
This commit is contained in:
		| @@ -76,6 +76,9 @@ RED.editor.colorPicker = RED.colorPicker = (function() { | |||||||
|             var focusTarget = colorInput; |             var focusTarget = colorInput; | ||||||
|             colorInput.on("change", function (e) { |             colorInput.on("change", function (e) { | ||||||
|                 var color = colorInput.val(); |                 var color = colorInput.val(); | ||||||
|  |                 if (options.defaultValue && !color.match(/^([a-z]+|#[0-9a-fA-F]{6}|#[0-9a-fA-F]{3})$/)) { | ||||||
|  |                     color = options.defaultValue; | ||||||
|  |                 } | ||||||
|                 colorHiddenInput.val(color).trigger('change'); |                 colorHiddenInput.val(color).trigger('change'); | ||||||
|                 refreshDisplay(color); |                 refreshDisplay(color); | ||||||
|             }); |             }); | ||||||
|   | |||||||
| @@ -235,6 +235,7 @@ | |||||||
|             RED.editor.colorPicker.create({ |             RED.editor.colorPicker.create({ | ||||||
|                 id: "red-ui-editor-node-color", |                 id: "red-ui-editor-node-color", | ||||||
|                 value: color, |                 value: color, | ||||||
|  |                 defaultValue: "#DDAA99", | ||||||
|                 palette: recommendedColors, |                 palette: recommendedColors, | ||||||
|                 sortPalette: function (a, b) {return a.l - b.l;} |                 sortPalette: function (a, b) {return a.l - b.l;} | ||||||
|             }).appendTo(colorRow); |             }).appendTo(colorRow); | ||||||
|   | |||||||
| @@ -101,6 +101,7 @@ RED.group = (function() { | |||||||
|             RED.editor.colorPicker.create({ |             RED.editor.colorPicker.create({ | ||||||
|                 id:"node-input-style-stroke", |                 id:"node-input-style-stroke", | ||||||
|                 value: style.stroke || defaultGroupStyle.stroke || "#a4a4a4", |                 value: style.stroke || defaultGroupStyle.stroke || "#a4a4a4", | ||||||
|  |                 defaultValue: "#a4a4a4", | ||||||
|                 palette: colorPalette, |                 palette: colorPalette, | ||||||
|                 cellPerRow: colorCount, |                 cellPerRow: colorCount, | ||||||
|                 cellWidth: 16, |                 cellWidth: 16, | ||||||
| @@ -112,6 +113,7 @@ RED.group = (function() { | |||||||
|             RED.editor.colorPicker.create({ |             RED.editor.colorPicker.create({ | ||||||
|                 id:"node-input-style-fill", |                 id:"node-input-style-fill", | ||||||
|                 value: style.fill || defaultGroupStyle.fill ||"none", |                 value: style.fill || defaultGroupStyle.fill ||"none", | ||||||
|  |                 defaultValue: "none", | ||||||
|                 palette: colorPalette, |                 palette: colorPalette, | ||||||
|                 cellPerRow: colorCount, |                 cellPerRow: colorCount, | ||||||
|                 cellWidth: 16, |                 cellWidth: 16, | ||||||
| @@ -129,6 +131,7 @@ RED.group = (function() { | |||||||
|             RED.editor.colorPicker.create({ |             RED.editor.colorPicker.create({ | ||||||
|                 id:"node-input-style-color", |                 id:"node-input-style-color", | ||||||
|                 value: style.color || defaultGroupStyle.color ||"#a4a4a4", |                 value: style.color || defaultGroupStyle.color ||"#a4a4a4", | ||||||
|  |                 defaultValue: "#a4a4a4", | ||||||
|                 palette: colorPalette, |                 palette: colorPalette, | ||||||
|                 cellPerRow: colorCount, |                 cellPerRow: colorCount, | ||||||
|                 cellWidth: 16, |                 cellWidth: 16, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user