Reputation: 80
I want to drag different (angular material) grid layout from one container to another. While dropping the layout it will automatically fit into that container.
Upvotes: 0
Views: 1352
Reputation: 17711
I use dragula.
It's as simple as:
dragula([document.getElementById(left), document.getElementById(right)])
.on('drag', function (el) {
el.className = el.className.replace('ex-moved', '');
}).on('drop', function (el) {
el.className += ' ex-moved';
}).on('over', function (el, container) {
container.className += ' ex-over';
}).on('out', function (el, container) {
container.className = container.className.replace('ex-over', '');
});
Disclaimer: I do not work nor did ever work for bevacqua... :-)
Upvotes: 2