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;
|
background-repeat: repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cm-colorview + .cm-colorview.cm-overlay::before,
|
/* overlay at the start splits our colorview: don't style the tail */
|
||||||
.cm-colorview.cm-overlay + .cm-colorview::before {
|
.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;
|
content: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -163,6 +163,17 @@
|
||||||
}
|
}
|
||||||
elements = elements || text.getElementsByClassName(OWN_DOM_CLASS);
|
elements = elements || text.getElementsByClassName(OWN_DOM_CLASS);
|
||||||
const el = elements[elementIndex++];
|
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) {
|
if (el.colorpickerData && el.colorpickerData.color === data.color) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user