fix(editor): inline latex editor should not be shown when doc is readonly (#9794)

[BS-2442](https://linear.app/affine-design/issue/BS-2442/只读时-inline-latex-node-点击不应该弹出-modal)
This commit is contained in:
donteatfriedrice
2025-01-20 15:44:07 +00:00
parent 092f9c84fa
commit f995f216bd
2 changed files with 65 additions and 0 deletions

View File

@@ -161,6 +161,9 @@ export class AffineLatexNode extends SignalWatcher(
this.disposables.addFromEvent(this, 'click', e => {
e.preventDefault();
e.stopPropagation();
if (this.readonly) {
return;
}
this.toggleEditor();
});
@@ -212,6 +215,10 @@ export class AffineLatexNode extends SignalWatcher(
);
}
get readonly() {
return this.std.store.readonly;
}
@property({ attribute: false })
accessor delta: DeltaInsert<AffineTextAttributes> = {
insert: ZERO_WIDTH_SPACE,