-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drag'n'drop support #445
Drag'n'drop support #445
Conversation
Caret module: initial
Sanitizer docs
split is ready
Module listeners
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- при перетаскивании из вебшторма, сафари зависает
- не удаляется исходный фрагмент
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- при dragstart надо скрывать inline toolbar
docs/tools.md
Outdated
@@ -167,4 +167,34 @@ static get onPaste() { | |||
|
|||
> Both `onPaste.handler` and `onPaste.patternHandler` can be `async` or return a `Promise`. | |||
|
|||
### Drag'n'drop handling | |||
|
|||
Your Tool can handle files drag'n'drop. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
files pasted by drag'n'drop
src/components/modules/dragNDrop.ts
Outdated
BlockManager.setCurrentBlockByChildNode(BlockManager.lastBlock.holder, 'end'); | ||
} | ||
|
||
if (!dropEvent.dataTransfer.files.length) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
надо оставить коммент
src/components/modules/dragNDrop.ts
Outdated
|
||
if (isHTML) { | ||
data = dropEvent.dataTransfer.getData('text/html'); | ||
data = '<p>' + data + '</p>'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
нужен коммент
src/components/modules/dragNDrop.ts
Outdated
|
||
let dataToInsert = []; | ||
|
||
if (dropEvent.dataTransfer.files.length) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
разве тут не всегда будет true? выше обратная проверка с return;
src/components/modules/paste.ts
Outdated
/** | ||
* Process pasted string and devide them into Blocks | ||
* | ||
* @param {string} data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
надо описать параметры
src/components/modules/paste.ts
Outdated
return; | ||
} | ||
|
||
if (SelectionUtils.isAtEditor && !Caret.isAtEnd && SelectionUtils.isCollapsed) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
нужен коммент
return { | ||
files: { | ||
mimeTypes: ['image/*'], | ||
extensions: ['json'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
лучше для более понятного примера написать png, jpg
resolves #402