aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/FontIconBox/FontIconBox.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/FontIconBox/FontIconBox.tsx')
-rw-r--r--src/client/views/nodes/FontIconBox/FontIconBox.tsx8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/client/views/nodes/FontIconBox/FontIconBox.tsx b/src/client/views/nodes/FontIconBox/FontIconBox.tsx
index cf07d98be..8290e102c 100644
--- a/src/client/views/nodes/FontIconBox/FontIconBox.tsx
+++ b/src/client/views/nodes/FontIconBox/FontIconBox.tsx
@@ -73,7 +73,7 @@ export class FontIconBox extends ViewBoxBaseComponent<ButtonProps>() {
};
specificContextMenu = (): void => {
- if (!Doc.noviceMode) {
+ if (!Doc.noviceMode && Cast(this.layoutDoc.dragFactory, Doc, null)) {
const cm = ContextMenu.Instance;
cm.addItem({ description: 'Show Template', event: this.showTemplate, icon: 'tag' });
cm.addItem({ description: 'Use as Render Template', event: this.dragAsTemplate, icon: 'tag' });
@@ -366,7 +366,7 @@ export class FontIconBox extends ViewBoxBaseComponent<ButtonProps>() {
);
}
- render() {
+ renderButton = () => {
const color = this._props.styleProvider?.(this.layoutDoc, this._props, StyleProp.Color);
const tooltip = StrCast(this.Document.toolTip);
const scriptFunc = () => ScriptCast(this.Document.onClick)?.script.run({ this: this.Document, self: this.Document, _readOnly_: false });
@@ -389,5 +389,9 @@ export class FontIconBox extends ViewBoxBaseComponent<ButtonProps>() {
background={SettingsManager.userBackgroundColor} size={Size.LARGE} tooltipPlacement='right' onPointerDown={scriptFunc} />;
}
return this.defaultButton;
+ };
+
+ render() {
+ return <div onContextMenu={this.specificContextMenu}>{this.renderButton()}</div>;
}
}