mirror of
https://github.com/docmost/docmost.git
synced 2026-05-15 05:04:06 +08:00
unify pulse
This commit is contained in:
@@ -321,12 +321,11 @@ export const Drawio = Node.create<DrawioOptions>({
|
||||
|
||||
// Show skeleton background while image loads from server
|
||||
dom.style.pointerEvents = "none";
|
||||
dom.style.background =
|
||||
"light-dark(var(--mantine-color-gray-2), var(--mantine-color-dark-6))";
|
||||
el.classList.add("media-pulse");
|
||||
|
||||
el.onload = () => {
|
||||
dom.style.pointerEvents = "";
|
||||
dom.style.background = "";
|
||||
el.classList.remove("media-pulse");
|
||||
};
|
||||
|
||||
return nodeView;
|
||||
|
||||
@@ -321,12 +321,11 @@ export const Excalidraw = Node.create<ExcalidrawOptions>({
|
||||
|
||||
// Show skeleton background while image loads from server
|
||||
dom.style.pointerEvents = "none";
|
||||
dom.style.background =
|
||||
"light-dark(var(--mantine-color-gray-2), var(--mantine-color-dark-6))";
|
||||
el.classList.add("media-pulse");
|
||||
|
||||
el.onload = () => {
|
||||
dom.style.pointerEvents = "";
|
||||
dom.style.background = "";
|
||||
el.classList.remove("media-pulse");
|
||||
};
|
||||
|
||||
return nodeView;
|
||||
|
||||
@@ -362,12 +362,11 @@ export const TiptapImage = Image.extend<ImageOptions>({
|
||||
|
||||
// Show skeleton background while image loads from server
|
||||
dom.style.pointerEvents = "none";
|
||||
dom.style.background =
|
||||
"light-dark(var(--mantine-color-gray-2), var(--mantine-color-dark-6))";
|
||||
el.classList.add("media-pulse");
|
||||
|
||||
el.onload = () => {
|
||||
dom.style.pointerEvents = "";
|
||||
dom.style.background = "";
|
||||
el.classList.remove("media-pulse");
|
||||
};
|
||||
|
||||
return nodeView;
|
||||
|
||||
@@ -329,12 +329,11 @@ export const TiptapVideo = Node.create<VideoOptions>({
|
||||
|
||||
// Show skeleton background while video loads from server
|
||||
dom.style.pointerEvents = "none";
|
||||
dom.style.background =
|
||||
"light-dark(var(--mantine-color-gray-2), var(--mantine-color-dark-6))";
|
||||
el.classList.add("media-pulse");
|
||||
|
||||
el.onloadedmetadata = () => {
|
||||
dom.style.pointerEvents = "";
|
||||
dom.style.background = "";
|
||||
el.classList.remove("media-pulse");
|
||||
};
|
||||
|
||||
return nodeView;
|
||||
|
||||
Reference in New Issue
Block a user