(a) Use a draggable list (class="js-draggable") such as com_menus (src/Model/ItemsModel.php). It is possible to drag a submenu item to a higher-level menu item, but the moved items is not associated with the higher-level menu item.
(b) Incorrect use of boolean
Can drag MENU 1.1 to under MENU 2 but MENU 1.1 is still under MENU 1 after reload. In J3, dragging was restricted within direct siblings only, so if that's still the way, then moving item under MENU 2 should not be permitted.
Linux Firefox 105.0 (64-bit)
Joomla 4.2.2
In "accepts", if (isNested) {
is not valid since isNested is a string (code block always true). Could revise to "true" == isNested. Or, fix upstream Joomla.getOptions to convert true/false strings to boolean.
This isn't perfect, but it keeps the sibling-only concept by checking that the sibling is not presently mirrored (i.e, not direct sibling) by checking for "gu-mirror" class attribute value. gu-mirror class is explained in dragula documentation.
media/system/js/draggable.js:
accepts(el, target, source, sibling) {
if ( "true" == isNested ) { //patch1
if ( sibling.classList.contains("gu-mirror")) return false; //patch2 (need same for "false" isNested condition?)
if (sibling !== null) {
return sibling.dataset.draggableGroup && sibling.dataset.draggableGroup === el.dataset.draggableGroup;
}
return sibling === null || sibling && sibling.tagName.toLowerCase() === 'tr';
}
return sibling === null || sibling && sibling.tagName.toLowerCase() === 'tr';
},
First submission here, so I hope I met community standards and requirements with this submission.
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
Moving element on higher level it not only javascript, but also require php changes to handle new/old parent and related changes to keep a tree in shape.
So not so easy.
Labels |
Added:
bug
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-03-30 21:34:40 |
Closed_By | ⇒ | Hackwar |
I've checked this issue again with Joomla 4.4 and it seems as if the bug has since been fixed. I also looked into the code and the value has been changed to a true boolean it seems. Thank you for reporting this issue. Closing for now. :-)
@Fedik or @dgrammatiko Could one of you two look at the suggested change to see if it is valid? If Yes, we can ask @muddygs to make PR . Thanks !