mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-30 00:29:46 +08:00
205cd7a86d
Closes: BS-2946
25 lines
686 B
TypeScript
25 lines
686 B
TypeScript
import type { GroupElementModel } from '@blocksuite/affine-model';
|
|
import { GfxElementModelView } from '@blocksuite/std/gfx';
|
|
|
|
import { mountGroupTitleEditor } from './text/edgeless-group-title-editor';
|
|
|
|
export class GroupElementView extends GfxElementModelView<GroupElementModel> {
|
|
static override type: string = 'group';
|
|
|
|
override onCreated(): void {
|
|
super.onCreated();
|
|
|
|
this._initDblClickToEdit();
|
|
}
|
|
|
|
private _initDblClickToEdit(): void {
|
|
this.on('dblclick', () => {
|
|
const edgeless = this.std.view.getBlock(this.std.store.root!.id);
|
|
|
|
if (edgeless && !this.model.isLocked()) {
|
|
mountGroupTitleEditor(this.model, edgeless);
|
|
}
|
|
});
|
|
}
|
|
}
|