mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
🐛 Fixed overly small file drop area in beta editor (#17682)
closes https://github.com/TryGhost/Product/issues/3449 - added drop handler to the whole editor pane area (to match previous editor) that uses the external API plugin to pass files through to the editor when dropped - allows images/files to be dropped outside of the main editor canvas which is especially helpful when creating images in a new post
This commit is contained in:
parent
05a4d2cc79
commit
f983e93090
3 changed files with 16 additions and 1 deletions
|
@ -5,6 +5,8 @@
|
||||||
class="gh-koenig-editor-pane flex flex-column mih-100"
|
class="gh-koenig-editor-pane flex flex-column mih-100"
|
||||||
{{on "mousedown" this.trackMousedown}}
|
{{on "mousedown" this.trackMousedown}}
|
||||||
{{on "mouseup" this.focusEditor}}
|
{{on "mouseup" this.focusEditor}}
|
||||||
|
{{on "dragover" this.editorPaneDragover}}
|
||||||
|
{{on "drop" this.editorPaneDrop}}
|
||||||
>
|
>
|
||||||
<GhEditorFeatureImage
|
<GhEditorFeatureImage
|
||||||
@image={{@featureImage}}
|
@image={{@featureImage}}
|
||||||
|
|
|
@ -40,6 +40,19 @@ export default class GhKoenigEditorReactComponent extends Component {
|
||||||
this.mousedownY = event.clientY;
|
this.mousedownY = event.clientY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@action
|
||||||
|
editorPaneDragover(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
@action
|
||||||
|
editorPaneDrop(event) {
|
||||||
|
if (event.dataTransfer.files.length > 0) {
|
||||||
|
event.preventDefault();
|
||||||
|
this.editorAPI?.insertFiles(Array.from(event.dataTransfer.files));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Title actions -----------------------------------------------------------
|
// Title actions -----------------------------------------------------------
|
||||||
|
|
||||||
@action
|
@action
|
||||||
|
|
Loading…
Add table
Reference in a new issue