mirror of
https://github.com/docmost/docmost.git
synced 2026-08-30 10:26:25 +08:00
fix: enhance lightbox (#2429)
* fix: close on click outside; smaller icon size * fix: make ALT more visible
This commit is contained in:
@@ -7,7 +7,7 @@ import {
|
||||
} from "@tiptap/core";
|
||||
import { ResizableNodeView } from "../resizable-nodeview";
|
||||
import type { ResizableNodeViewDirection } from "../resizable-nodeview";
|
||||
import { normalizeFileUrl } from "../media-utils";
|
||||
import { normalizeFileUrl, syncAltBadge } from "../media-utils";
|
||||
|
||||
export type ImageResizeOptions = {
|
||||
enabled: boolean;
|
||||
@@ -316,6 +316,8 @@ export const TiptapImage = Image.extend<ImageOptions>({
|
||||
const container = nodeView.dom as HTMLElement;
|
||||
applyAlignment(container, align);
|
||||
|
||||
syncAltBadge(nodeView.wrapper, updatedNode.attrs.alt);
|
||||
|
||||
currentNode = updatedNode;
|
||||
return true;
|
||||
},
|
||||
@@ -333,6 +335,8 @@ export const TiptapImage = Image.extend<ImageOptions>({
|
||||
|
||||
const dom = nodeView.dom as HTMLElement;
|
||||
|
||||
syncAltBadge(nodeView.wrapper, node.attrs.alt);
|
||||
|
||||
// Apply initial alignment
|
||||
applyAlignment(dom, node.attrs.align || "center");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user