Open nexushoratio opened 4 weeks ago
Was doing some more research. Just capturing some thoughts while in my head. May be completely off:
fit
drop
event received by a droppable, use .position()
to tie the items together and listener on some TBD event on the draggableTBD
event received by droppable, undo the work by .position()
Assume the hand-wavy stuff works, that would probably handle the case when the sidebar changes sizes. But unsure what to do when the sidebar is toggled. (Maybe instead make it possible for a draggable to go into the sidebar as a sortable? Dunno, just making things up at this point. Time for bed.)
TIL that the
dialog()
wrapper sets up snapping by default. Well, at least to other draggables.What about defaulting them to also snap to the sidebar?
It looks like the change is simple enough. Change this line: https://github.com/IITC-CE/ingress-intel-total-conversion/blob/199c9f7bdc0acb79db3855f9f5cd7c0cd516ec66/core/code/dialog.js#L238
to read:
dialog.dialog().parents('.ui-dialog').draggable('option', 'snap', '.ui-draggable, #sidebar');
(I don't have my test code in my editor still, so the details on the selectors may be wrong, so verify.)
Bonus if someone could figure out how to make them dock instead of just snap so that as the sidebar changes size, the dialogs stay relative. But I did not see anything in my few minutes of checking the jQuery UI documentation.