mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-22 11:01:54 +03:00
UBERF-7065 Fix file and image upload extensions (#5668)
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
parent
2e6b0f3937
commit
27a98e0641
@ -92,11 +92,14 @@ export const FileUploadExtension = Extension.create<FileUploadOptions>({
|
||||
}
|
||||
},
|
||||
handleDrop (view, event) {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
const dataTransfer = event.dataTransfer
|
||||
if (dataTransfer !== null) {
|
||||
return handleDrop(view, view.posAtCoords({ left: event.x, top: event.y }), dataTransfer)
|
||||
const res = handleDrop(view, view.posAtCoords({ left: event.x, top: event.y }), dataTransfer)
|
||||
if (res === true) {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
return res
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -118,11 +118,14 @@ export const ImageUploadExtension = Extension.create<ImageUploadOptions>({
|
||||
}
|
||||
},
|
||||
handleDrop (view, event) {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
const dataTransfer = event.dataTransfer
|
||||
if (dataTransfer !== null) {
|
||||
return handleDrop(view, view.posAtCoords({ left: event.x, top: event.y }), dataTransfer)
|
||||
const res = handleDrop(view, view.posAtCoords({ left: event.x, top: event.y }), dataTransfer)
|
||||
if (res === true) {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
return res
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user