Opened 4 years ago

Last modified 4 years ago

#13464 confirmed New Feature

Expose simple way to trigger lineutils-based DnD

Reported by: Piotrek Koszuliński Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description (last modified by Piotrek Koszuliński)

(Note: lineutils-based DnD is the mechanism used while dragging block widgets)

Use cases:

  1. When user starts dragging an inline image (or image2) I would like to be able to enable line-utils-based DnD. I imagine that I can listen on editor#dragstart, check what's dragged, and use some editor method, to do what I want. Of course this rises questions like - what with empty blocks left after dragging an image from them - this would be handled by the developer which implements such feature or by CKEditor. We could e.g. make it possible to alter dragRange (it may even be possible now) so a developer would be able to select whole paragraph.
  1. Dragging some stuff from outside of the editor. E.g. there could be a list of products and dragging it into editor should be done with line utils.
  1. Dragging table rows with line utils?
  1. Must it be drag and drop? Maybe we can expose this feature for more user actions. You click a widget, choose "move" and while your moving your cursor above the editor, then line utils appear with an icon like magicline. Clicking this icon moves the element there.
    • With some more UX-related improvements we could enable magicline and lineutils-based DnD on touch devices.

Change History (6)

comment:1 Changed 4 years ago by Piotrek Koszuliński

Description: modified (diff)
Status: newconfirmed

comment:2 Changed 4 years ago by Piotrek Koszuliński

Description: modified (diff)

comment:3 Changed 4 years ago by Piotrek Koszuliński

Description: modified (diff)

comment:4 Changed 4 years ago by Piotrek Koszuliński

Description: modified (diff)

comment:5 Changed 4 years ago by Piotr Jasiun

Ad. 1:

I imagine that I can listen on editor#dragstart...

I'm not sure about that. At the moment we listen on mouse event and emulate dragstart event from the line-utils-based drag and drop (custom D&D for block widgets), so the line utils is the alternative way and we do not use at all browsers D&D if we use lineutils and it is lineutils based mechanism who fire all D&D events on editor. If we mix this two solutions we may have some problems. I prefer lineutils as an alternative way of drag and drop so all D&D events (dragstart, drop, dragend) will be fired by this alternative mechanism.

But on the other hand, maybe we will be able to prevent native D&D in the editor#dragstart event. It is something we should check. And solution with setting lineutils on editor#dragstart would be very nice.

Ad. 2:

Dragging some stuff from outside of the editor.

Note that editor#dragstart will not we fired in such case (dragstart and dragend are fired on the dragged element). So there should be a way to run them manually in the simplest possible way.

I believe we should keep in mind that it is possible to run lineutils for all of these cases now. The problem is that it is too generic and too complex, so this ticket is not about introducing new features, but about making feature simpler.

Last edited 4 years ago by Piotr Jasiun (previous) (diff)

comment:6 Changed 4 years ago by Olek Nowodziński

cc

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy