Task #80024
closedDragDrop.js - show dragged element in front of every element
0%
Description
Please extend the configuration with these two parameters:
appendTo: $(document.body), helper: 'clone',
so the dragged element is displayed in front of every element during dragging and can be used with third party extension which creates multi column in elements (e.g. flux)
Here the changed code for typo3/sysext/backend/Resources/Public/JavaScript/LayoutModule/DragDrop.js
(starting at line 43)
Insert appendTo
and helper
in the $(DragDrop.contentIdentifier).draggable
configuration:
DragDrop.initialize = function () { $(DragDrop.contentIdentifier).draggable({ handle: this.dragHeaderIdentifier, scope: 'tt_content', cursor: 'move', distance: 20, addClasses: 'active-drag', revert: 'invalid', zIndex: 100, appendTo: $(document.body), helper: 'clone', start: function (evt, ui) { DragDrop.onDragStart($(this)); }, stop: function (evt, ui) { DragDrop.onDragStop($(this)); } });
Updated by Frank Rakow over 7 years ago
Frank Rakow wrote:
Sorry this is the correct changed code:
$(DragDrop.contentIdentifier).draggable({ handle: this.dragHeaderIdentifier, scope: 'tt_content', cursor: 'move', distance: 20, addClasses: 'active-drag', revert: 'invalid', zIndex: 100, appendTo: $(document.body), helper: 'clone', create: function(evt, ui) { }, start: function (evt, ui) { DragDrop.onDragStart(ui.helper); }, stop: function (evt, ui) { DragDrop.onDragStop(ui.helper); } });
Additional changes: DragDrop.onDragStart(ui.helper);
and DragDrop.onDragStop(ui.helper);
.
Use ui.helper
instead of $(this)
otherwise the displayed dragging element is wrong.
Updated by Frank Nägler about 7 years ago
- Status changed from New to Closed
This issue has been fixed already in v8 and master. I will close issue.
If you think this a wrong decision, feel free to open a new issue or re-open this issue.