-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
4.0.6, 4.1.1
-
MOODLE_400_STABLE, MOODLE_401_STABLE
The core/dragdrop JavaScript library was added to Moodle at a time when jQuery was very much flavour-of-the-month.
This means that, not only does this module use jQuery internally, but other code that wants to use it also has to use jQuery, becuse you need to pass jQuery objects to its a API.
The question is, can we change that, without breaking backwards-compatibility? I think we could, like this:
- Change the public methods of this module (prepare and start) so they will accept either jQuery objects or plain DOM nodes (arguements event and dragProxy).
- And, when they are called, they need to record which sort of interaction the calling code wants. (Not quite clear where to store that. Possibly enough to just store this info in the start method, and it could be stored on the dragProxy.)
- When this module calls the provided callbacks onMove and onDrop, it passes the type of object (jQuery or plain) which were passed to it.
The other option would be to make a new module for jQuery-less drag-drop, but hard to think of a better name than 'dragdrop'.
- has a non-specific relationship to
-
MDL-72293 Trigger native JS events in sortable list module
-
- Closed
-