3

I am using a generic Garnish modal from Craft like so:

$container = $('.upload-modal');

$modal = new Garnish.Modal($container, {
    autoShow: false
});

I would like to have craft's native drag&drop support in this modal, i tried something like this

$dragDrop = new Garnish.DragDrop({
    dropTargets: ['.upload-modal__drop']
});

Can someone point me in the right direction. I tried to find some answers here:

https://github.com/pixelandtonic/garnishjs/blob/master/src/classes/DragDrop.js

Eventually what i am trying to achieve here, is a basic modal without any link to existing assets or so, for uploading a file with dragdrop and file select functionality. This file when processed by the plugin needs te be deleted afterwards.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.