Improvements/fixes for detachable editor drag handling
This commit is contained in:
parent
48c59197f6
commit
242926ae8a
|
@ -169,8 +169,11 @@ const Editor = props => {
|
||||||
!widgets.some(isReadOnlyWidget); // every widget is deletable
|
!widgets.some(isReadOnlyWidget); // every widget is deletable
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Draggable onStart={() => setDragged(true)}>
|
<Draggable
|
||||||
<div ref={element} className="r6o-editor">
|
cancel=".r6o-btn, .r6o-nodrag"
|
||||||
|
onDrag={() => setDragged(true)}>
|
||||||
|
|
||||||
|
<div ref={element} className={dragged ? 'r6o-editor dragged' : 'r6o-editor'}>
|
||||||
<div className="r6o-arrow" />
|
<div className="r6o-arrow" />
|
||||||
<div className="r6o-editor-inner">
|
<div className="r6o-editor-inner">
|
||||||
{widgets.map(widget =>
|
{widgets.map(widget =>
|
||||||
|
@ -215,6 +218,7 @@ const Editor = props => {
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</Draggable>
|
</Draggable>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ const Comment = props => {
|
||||||
/> }
|
/> }
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className={isMenuVisible ? "r6o-icon r6o-arrow-down r6o-menu-open" : "r6o-icon r6o-arrow-down"}
|
className={isMenuVisible ? "r6o-icon r6o-arrow-down r6o-nodrag r6o-menu-open" : "r6o-icon r6o-arrow-down r6o-nodrag"}
|
||||||
onClick={() => setIsMenuVisible(!isMenuVisible)}>
|
onClick={() => setIsMenuVisible(!isMenuVisible)}>
|
||||||
<ChevronDownIcon width={12} />
|
<ChevronDownIcon width={12} />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -10,7 +10,7 @@ const DropdownMenu = props => {
|
||||||
useClickOutside(ref, () => props.onClickOutside());
|
useClickOutside(ref, () => props.onClickOutside());
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ul ref={ref} className="r6o-comment-dropdown-menu">
|
<ul ref={ref} className="r6o-comment-dropdown-menu r6o-nodrag">
|
||||||
<li onClick={props.onEdit}>{i18n.t('Edit')}</li>
|
<li onClick={props.onEdit}>{i18n.t('Edit')}</li>
|
||||||
<li onClick={props.onDelete}>{i18n.t('Delete')}</li>
|
<li onClick={props.onDelete}>{i18n.t('Delete')}</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -22,7 +22,7 @@ export default class TextEntryField extends Component {
|
||||||
return (
|
return (
|
||||||
<TextareaAutosize
|
<TextareaAutosize
|
||||||
ref={this.onRender}
|
ref={this.onRender}
|
||||||
className="r6o-editable-text"
|
className={this.props.editable ? 'r6o-editable-text r6o-nodrag' : 'r6o-editable-text'}
|
||||||
value={this.props.content}
|
value={this.props.content}
|
||||||
placeholder={this.props.placeholder || i18n.t('Add a comment...')}
|
placeholder={this.props.placeholder || i18n.t('Add a comment...')}
|
||||||
disabled={!this.props.editable}
|
disabled={!this.props.editable}
|
||||||
|
|
|
@ -59,7 +59,7 @@ const TagWidget = props => {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="r6o-widget r6o-tag">
|
<div className="r6o-widget r6o-tag r6o-nodrag">
|
||||||
{ tags.length > 0 &&
|
{ tags.length > 0 &&
|
||||||
<ul className="r6o-taglist">
|
<ul className="r6o-taglist">
|
||||||
{ tags.map(tag =>
|
{ tags.map(tag =>
|
||||||
|
|
|
@ -116,7 +116,7 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.r6o-editor.react-draggable-dragged .r6o-arrow {
|
.r6o-editor.dragged .r6o-arrow {
|
||||||
display:none;
|
display:none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue