perf: More decoration caching
This commit is contained in:
@@ -171,11 +171,17 @@ export default class Table extends Node {
|
||||
|
||||
if (shadowRight) {
|
||||
decorations.push(
|
||||
Decoration.widget(pos + 1, () => {
|
||||
const shadow = document.createElement("div");
|
||||
shadow.className = "scrollable-shadow right";
|
||||
return shadow;
|
||||
})
|
||||
Decoration.widget(
|
||||
pos + 1,
|
||||
() => {
|
||||
const shadow = document.createElement("div");
|
||||
shadow.className = "scrollable-shadow right";
|
||||
return shadow;
|
||||
},
|
||||
{
|
||||
key: "table-shadow-right",
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
index++;
|
||||
|
||||
@@ -124,12 +124,18 @@ export default class BlockMenuTrigger extends Extension {
|
||||
if (isTopLevel) {
|
||||
if (isEmpty) {
|
||||
decorations.push(
|
||||
Decoration.widget(parent.pos, () => {
|
||||
button.addEventListener("click", () => {
|
||||
this.editor.events.emit(EventType.blockMenuOpen, "");
|
||||
});
|
||||
return button;
|
||||
})
|
||||
Decoration.widget(
|
||||
parent.pos,
|
||||
() => {
|
||||
button.addEventListener("click", () => {
|
||||
this.editor.events.emit(EventType.blockMenuOpen, "");
|
||||
});
|
||||
return button;
|
||||
},
|
||||
{
|
||||
key: "block-trigger",
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
decorations.push(
|
||||
|
||||
Reference in New Issue
Block a user