onBeforeLightbox and onDragEnd not working together


#1

I have implemented the lightbox feature using onBeforeLightbox in the one platform where it’s working fine but when I added the onDragEnd then the lightbox is not opening. So basically I am unable to execute both events simultaneously. Like if I execute the drag end event then when I double click on that event then it’s only called the onDragEnd not the onBeforeLightbox. Please someone help me to figure out the issue.


#2

Hello @dekts,

Currently you can detect the dblClick / drag using the setTimeout inside the onDragEnd event like follows:

var dblclickEv = 0;

scheduler.attachEvent("onDragEnd", function(id, e){
setTimeout(function() {
if (dblclickEv){
console.log('onDragEnd after onDblClick');
} else {
console.log('onDragEnd');
}
return true;
}, 200)
dblclickEv= 0;
});

scheduler.attachEvent("onDblClick", function (id, e) {
console.log('onDblClick');
dblclickEv = 1;
});

Here is a demo:
http://snippet.dhtmlx.com/5/dc5015611

Kind regards,