mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 05:14:54 +00:00
refactor(editor): render presentation toolbar on demand (#9442)
This commit is contained in:
@@ -657,17 +657,18 @@ export class EdgelessToolbarWidget extends WidgetComponent<
|
||||
@mousedown=${stopPropagation}
|
||||
@pointerdown=${stopPropagation}
|
||||
>
|
||||
<presentation-toolbar
|
||||
.visible=${this.isPresentMode}
|
||||
.edgeless=${this.block}
|
||||
.settingMenuShow=${this.presentSettingMenuShow}
|
||||
.frameMenuShow=${this.presentFrameMenuShow}
|
||||
.setSettingMenuShow=${(show: boolean) =>
|
||||
(this.presentSettingMenuShow = show)}
|
||||
.setFrameMenuShow=${(show: boolean) =>
|
||||
(this.presentFrameMenuShow = show)}
|
||||
.containerWidth=${this.containerWidth}
|
||||
></presentation-toolbar>
|
||||
${this.isPresentMode
|
||||
? html`<presentation-toolbar
|
||||
.edgeless=${this.block}
|
||||
.settingMenuShow=${this.presentSettingMenuShow}
|
||||
.frameMenuShow=${this.presentFrameMenuShow}
|
||||
.setSettingMenuShow=${(show: boolean) =>
|
||||
(this.presentSettingMenuShow = show)}
|
||||
.setFrameMenuShow=${(show: boolean) =>
|
||||
(this.presentFrameMenuShow = show)}
|
||||
.containerWidth=${this.containerWidth}
|
||||
></presentation-toolbar>`
|
||||
: nothing}
|
||||
${this.isPresentMode ? nothing : this._renderContent()}
|
||||
</div>
|
||||
</smooth-corner>
|
||||
|
||||
@@ -322,7 +322,7 @@ export class PresentationToolbar extends EdgelessToolbarToolMixin(
|
||||
return html`
|
||||
<style>
|
||||
:host {
|
||||
display: ${this.visible ? 'flex' : 'none'};
|
||||
display: flex;
|
||||
}
|
||||
</style>
|
||||
<edgeless-tool-icon-button
|
||||
@@ -442,9 +442,6 @@ export class PresentationToolbar extends EdgelessToolbarToolMixin(
|
||||
|
||||
@property({ type: Boolean })
|
||||
accessor settingMenuShow = false;
|
||||
|
||||
@property({ attribute: true, type: Boolean })
|
||||
accessor visible = true;
|
||||
}
|
||||
|
||||
declare global {
|
||||
|
||||
Reference in New Issue
Block a user