@evercoder/mquill
Advanced tools
Comparing version
@@ -92,4 +92,23 @@ import Parchment from 'parchment'; | ||
mqUpdateBulletColor(blot) { | ||
if (blot.domNode.children.length) { | ||
const color = blot.domNode.children[0].style.color; | ||
const allChildrenHaveSameColor = [...blot.domNode.children].every( | ||
(child) => child.style.color === color | ||
); | ||
if (allChildrenHaveSameColor) { | ||
blot.domNode.style.color = color; | ||
} else { | ||
blot.domNode.style.removeProperty('color'); | ||
} | ||
} | ||
} | ||
insertBefore(blot, ref) { | ||
if (blot instanceof ListItem) { | ||
// This runs whenever the nodes get reconstructed (e.g. entering edit mode) | ||
this.mqUpdateBulletColor(blot); | ||
super.insertBefore(blot, ref); | ||
@@ -96,0 +115,0 @@ } else { |
{ | ||
"name": "@evercoder/mquill", | ||
"version": "1.4.10", | ||
"version": "1.4.11", | ||
"description": "Your powerful, rich text editor", | ||
@@ -5,0 +5,0 @@ "author": "Jason Chen <jhchen7@gmail.com>", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
2322200
0.17%25178
0.14%