Opened 11 years ago
Closed 10 years ago
#12169 closed New Feature (fixed)
Drop events.
Reported by: | Piotr Jasiun | Owned by: | Piotr Jasiun |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 4.5.0 Beta |
Component: | General | Version: | |
Keywords: | Cc: |
Description
Part of #11437.
Editor should emit drag & drop events with data transfer facade.
Change History (17)
comment:1 Changed 11 years ago by
Type: | Bug → New Feature |
---|
comment:2 Changed 11 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:3 Changed 11 years ago by
Resolution: | invalid |
---|---|
Status: | closed → reopened |
We decided that we need such facade.
comment:4 Changed 11 years ago by
Status: | reopened → confirmed |
---|
comment:5 Changed 11 years ago by
Owner: | set to Piotr Jasiun |
---|---|
Status: | confirmed → assigned |
comment:6 Changed 11 years ago by
Milestone: | → CKEditor 4.5.0 |
---|
comment:7 Changed 11 years ago by
Status: | assigned → review |
---|
comment:11 follow-up: 12 Changed 10 years ago by
Status: | review → review_failed |
---|
- https://github.com/cksource/ckeditor-dev/blob/2f98e75bbedd3f12beff015f044dc12212ecb3d9/plugins/clipboard/plugin.js#L1235 - why do you prevent the default there? The same is done inside the fireDragEvent.
- Run linter.
- https://github.com/cksource/ckeditor-dev/blob/2f98e75bbedd3f12beff015f044dc12212ecb3d9/plugins/clipboard/plugin.js#L1412-L1415 - mixed indentation.
- https://github.com/cksource/ckeditor-dev/blob/2f98e75bbedd3f12beff015f044dc12212ecb3d9/plugins/clipboard/plugin.js#L1401 - use dom.event#getTarget().
- "Facade for native
editable.drop
event." - don't mention editable here, becuase it's confusing. - https://github.com/cksource/ckeditor-dev/blob/2f98e75bbedd3f12beff015f044dc12212ecb3d9/tests/plugins/clipboard/drop.js#L150 - don't do that - as I said many times, longer timeouts should be avoided. Use afterPaste plus, if required, 0ms timeout.
comment:12 Changed 10 years ago by
Status: | review_failed → review |
---|
Fixed.
About:
- https://github.com/cksource/ckeditor-dev/blob/2f98e75bbedd3f12beff015f044dc12212ecb3d9/tests/plugins/clipboard/drop.js#L150 - don't do that - as I said many times, longer timeouts should be avoided. Use afterPaste plus, if required, 0ms timeout.
I cannot use 'afterPaste', because this is a case when there is no paste
nor afterPaste
events and I need to wait to check if no paste event were fired. But I decreased timeout from 300 to 0.
comment:13 Changed 10 years ago by
I cannot use 'afterPaste', because this is a case when there is no paste nor afterPaste events and I need to wait to check if no paste event were fired. But I decreased timeout from 300 to 0.
Hmm... Yeah, so this is more problematic. You can verify that 0ms is enough by breaking code and checking if test failed. If you used TDD you would be sure ;)
comment:14 follow-up: 15 Changed 10 years ago by
I set expectedPasteEventCount
to 0 and all tests which fire paste event were red, so timeout 0 is not too small (paste was fired before event count was checked).
This should be checked again for #12173.
comment:15 Changed 10 years ago by
Replying to pjasiun:
I set
expectedPasteEventCount
to 0 and all tests which fire paste event were red, so timeout 0 is not too small (paste was fired before event count was checked).
I rather meant breaking plugin's code, not tests. You may not predict that in case in which event is cancelled paste event may be fired differently. That's why you should break the place where a decision is made whether to continue firing events process. That's why TDD is much better, because you first see the test failing.
comment:16 Changed 10 years ago by
Status: | review → review_passed |
---|
comment:17 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | review_passed → closed |
I change if the change in the code causes red test and it does.
Majorized with hash: git:1bb7369.
We don't need editor#drop (as agreed in #11437) and we don't see yet need for editor#drag.