+ grip.addEventListener('mousedown', function() {
+ console.log("Drag started");
+ uls = document.getElementsByTagName("ul");
+ for (let ul of uls) {
+ ul.setAttribute("draggable", "true");
+ ul.addEventListener('dragstart', dragStart, false);
+ ul.addEventListener('dragenter', dragEnter, false);
+ ul.addEventListener('dragover', dragOver, false);
+ ul.addEventListener('dragleave', dragLeave, false);
+ ul.addEventListener('drop', drop, false);
+ }
+ });
+
+ grip.addEventListener('mouseup', function() {
+ console.log("Drag ended");
+ uls = document.getElementsByTagName("ul");
+ for (let ul of uls) {
+ ul.setAttribute("draggable", "false");
+ ul.removeEventListener('dragstart');
+ ul.removeEventListener('dragenter');
+ ul.removeEventListener('dragover');
+ ul.removeEventListener('dragleave');
+ ul.removeEventListener('drop');
+ }
+ });