aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/FormattedTextBox.tsx
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-04-10 21:35:12 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-04-10 21:35:12 -0400
commit4e45ad641bd34c4703188e69a93a23243f3659a4 (patch)
treecb618bdd394ea8325887aa1dfad06b4adf69fd2f /src/client/views/nodes/FormattedTextBox.tsx
parent1c660a6e768cea8d5e162be8082659743792cc3d (diff)
fixed text menu and text dragging.
Diffstat (limited to 'src/client/views/nodes/FormattedTextBox.tsx')
-rw-r--r--src/client/views/nodes/FormattedTextBox.tsx13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/client/views/nodes/FormattedTextBox.tsx b/src/client/views/nodes/FormattedTextBox.tsx
index eb40a03a5..69086df42 100644
--- a/src/client/views/nodes/FormattedTextBox.tsx
+++ b/src/client/views/nodes/FormattedTextBox.tsx
@@ -70,12 +70,16 @@ export class FormattedTextBox extends React.Component<FieldViewProps> {
const config = {
schema,
inpRules, //these currently don't do anything, but could eventually be helpful
- plugins: [
+ plugins: this.props.fieldKey === KeyStore.Archives ? [
history(),
keymap({ "Mod-z": undo, "Mod-y": redo }),
keymap(baseKeymap),
this.tooltipMenuPlugin()
- ]
+ ] : [
+ history(),
+ keymap({ "Mod-z": undo, "Mod-y": redo }),
+ keymap(baseKeymap),
+ ]
};
if (this.props.fieldKey === KeyStore.Archives) {
@@ -150,7 +154,7 @@ export class FormattedTextBox extends React.Component<FieldViewProps> {
// doc.SetData(fieldKey, e.target.value, RichTextField);
}
onPointerDown = (e: React.PointerEvent): void => {
- if (e.buttons === 1 && this.props.isSelected() && !e.altKey) {
+ if (e.buttons === 1 && this.props.isSelected() && !e.altKey && !e.ctrlKey && !e.metaKey) {
e.stopPropagation();
}
}
@@ -202,9 +206,10 @@ export class FormattedTextBox extends React.Component<FieldViewProps> {
}
tooltipMenuPlugin() {
+ let myprops = this.props;
return new Plugin({
view(_editorView) {
- return new TooltipTextMenu(_editorView);
+ return new TooltipTextMenu(_editorView, myprops);
}
});
}