assign color swatches correctly: skip overlays in the middle
This commit is contained in:
parent
7f37b8d1dd
commit
ce8a0a2d42
|
@ -17,8 +17,12 @@
|
|||
background-repeat: repeat;
|
||||
}
|
||||
|
||||
.cm-colorview + .cm-colorview.cm-overlay::before,
|
||||
.cm-colorview.cm-overlay + .cm-colorview::before {
|
||||
/* overlay at the start splits our colorview: don't style the tail */
|
||||
.cm-colorview.cm-overlay + .cm-colorview:not([data-colorpicker])::before,
|
||||
/* overlay in the middle splits our colorview: don't style the middle */
|
||||
.cm-colorview + .cm-colorview.cm-overlay:not([data-colorpicker])::before,
|
||||
/* ...and the tail */
|
||||
.cm-colorview + .cm-colorview.cm-overlay:not([data-colorpicker]) + .cm-colorview:not([data-colorpicker])::before {
|
||||
content: none;
|
||||
}
|
||||
|
||||
|
|
|
@ -163,6 +163,17 @@
|
|||
}
|
||||
elements = elements || text.getElementsByClassName(OWN_DOM_CLASS);
|
||||
const el = elements[elementIndex++];
|
||||
while (true) {
|
||||
const nextStyle = styles[i + 3];
|
||||
const nextStart = styles[i];
|
||||
if (nextStyle && nextStyle.includes(OWN_TOKEN_NAME) &&
|
||||
nextStart > start && nextStart <= start + data.color.length) {
|
||||
elementIndex++;
|
||||
i += 2;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (el.colorpickerData && el.colorpickerData.color === data.color) {
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user