From 242926ae8adae35882a83dd521e4ef20d4902023 Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Sat, 19 Jun 2021 18:12:14 +0200 Subject: [PATCH] Improvements/fixes for detachable editor drag handling --- src/editor/Editor.jsx | 8 ++++++-- src/editor/widgets/comment/Comment.jsx | 2 +- src/editor/widgets/comment/DropdownMenu.jsx | 2 +- src/editor/widgets/comment/TextEntryField.jsx | 2 +- src/editor/widgets/tag/TagWidget.jsx | 2 +- themes/default/editor/_editor.scss | 2 +- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/editor/Editor.jsx b/src/editor/Editor.jsx index ae3cb82..1fa4f90 100644 --- a/src/editor/Editor.jsx +++ b/src/editor/Editor.jsx @@ -169,8 +169,11 @@ const Editor = props => { !widgets.some(isReadOnlyWidget); // every widget is deletable return ( - setDragged(true)}> -
+ setDragged(true)}> + +
{widgets.map(widget => @@ -215,6 +218,7 @@ const Editor = props => { )}
+ ) diff --git a/src/editor/widgets/comment/Comment.jsx b/src/editor/widgets/comment/Comment.jsx index cc9b9dc..2369e35 100644 --- a/src/editor/widgets/comment/Comment.jsx +++ b/src/editor/widgets/comment/Comment.jsx @@ -66,7 +66,7 @@ const Comment = props => { /> }
setIsMenuVisible(!isMenuVisible)}>
diff --git a/src/editor/widgets/comment/DropdownMenu.jsx b/src/editor/widgets/comment/DropdownMenu.jsx index 43903f5..60b2d82 100644 --- a/src/editor/widgets/comment/DropdownMenu.jsx +++ b/src/editor/widgets/comment/DropdownMenu.jsx @@ -10,7 +10,7 @@ const DropdownMenu = props => { useClickOutside(ref, () => props.onClickOutside()); return ( -
    +
    • {i18n.t('Edit')}
    • {i18n.t('Delete')}
    diff --git a/src/editor/widgets/comment/TextEntryField.jsx b/src/editor/widgets/comment/TextEntryField.jsx index 1585ea0..cbd5e46 100644 --- a/src/editor/widgets/comment/TextEntryField.jsx +++ b/src/editor/widgets/comment/TextEntryField.jsx @@ -22,7 +22,7 @@ export default class TextEntryField extends Component { return ( { } return ( -
    +
    { tags.length > 0 &&
      { tags.map(tag => diff --git a/themes/default/editor/_editor.scss b/themes/default/editor/_editor.scss index df6d3e5..89e0540 100644 --- a/themes/default/editor/_editor.scss +++ b/themes/default/editor/_editor.scss @@ -116,7 +116,7 @@ } -.r6o-editor.react-draggable-dragged .r6o-arrow { +.r6o-editor.dragged .r6o-arrow { display:none; }