Skip to content
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

Merged
merged 340 commits into from
Sep 27, 2018
Merged

Drag'n'drop support #445

merged 340 commits into from
Sep 27, 2018

Conversation

gohabereg
Copy link
Member

resolves #402

Copy link
Member

@neSpecc neSpecc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • при перетаскивании из вебшторма, сафари зависает
  • не удаляется исходный фрагмент

Copy link
Member

@neSpecc neSpecc left a 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.
Copy link
Member

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 Show resolved Hide resolved
BlockManager.setCurrentBlockByChildNode(BlockManager.lastBlock.holder, 'end');
}

if (!dropEvent.dataTransfer.files.length) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

надо оставить коммент


if (isHTML) {
data = dropEvent.dataTransfer.getData('text/html');
data = '<p>' + data + '</p>';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нужен коммент


let dataToInsert = [];

if (dropEvent.dataTransfer.files.length) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

разве тут не всегда будет true? выше обратная проверка с return;

/**
* Process pasted string and devide them into Blocks
*
* @param {string} data
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

надо описать параметры

return;
}

if (SelectionUtils.isAtEditor && !Caret.isAtEnd && SelectionUtils.isCollapsed) {
Copy link
Member

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']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

лучше для более понятного примера написать png, jpg

@gohabereg gohabereg merged commit 577da8f into master Sep 27, 2018
@gohabereg gohabereg deleted the issue-402 branch September 27, 2018 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Paste должен обрабатывать вставку драг-н-дропом
5 participants