Hello i have a problem just today (i think) after fivem update my drag and drop script dont work any more
so its work when you drag its registering the drag but when you drag over or enter another box its not working
DragNSort.prototype.onDragStart = function (_this, event) {
_this.$activeItem = this;
fromslot = this.firstChild.id
firstitem = this.firstChild.className
oldqte = document.getElementById(fromslot).firstChild.innerHTML.match(/[^(]*/i)[0]
//iteminfo(firstitem.split(' ').slice(2)[0])
// this is working
if (!(firstitem === "ts im empty")) {
this.classList.add(_this.dragStartClass);
event.dataTransfer.effectAllowed = 'move';
event.dataTransfer.setData('text/html', this.innerHTML);
}
};
DragNSort.prototype.onDragEnd = function (_this) {
if (!(firstitem === "ts im empty")) {
// this is working
this.classList.remove(_this.dragStartClass);
}
};
DragNSort.prototype.onDragEnter = function (_this) {
if (!(firstitem === "ts im empty")) {
// this is not working
this.classList.add(_this.dragEnterClass);
}
};
DragNSort.prototype.onDragLeave = function (_this) {
if (!(firstitem === "ts im empty")) {
// this is not working
this.classList.remove(_this.dragEnterClass);
}
};
DragNSort.prototype.onDragOver = function (_this, event) {
// this is not working
if (event.preventDefault) {
event.preventDefault();
}
event.dataTransfer.dropEffect = 'move';
return false;
};
sorry for bad english and thank you