Merge pull request #106 from nicofrand/fixSSOMobileClick

Fix regression on mobile: overlay not clickable
This commit is contained in:
Bram 2018-09-02 20:31:19 +02:00 committed by GitHub
commit e5103c5298
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -123,9 +123,6 @@ var dragg = function(id) {
this.x_elem = 0, this.y_elem = 0; // Stores top, left values (edge) of the element
var _initDrag = function(e){
// Prevent firefox native D'n'D behavior
window.eventPreventDefault(e);
if (e.type === "touchstart"){
x_pos = e.touches[0].clientX;
y_pos = e.touches[0].clientY;
@ -157,6 +154,11 @@ var dragg = function(id) {
}
};
// Prevent native D'n'D behavior
window.addEvent(elem, 'dragstart', function(e){
window.eventPreventDefault(e);
});
// Start dragging
window.addEvent(elem, 'mousedown', _initDrag);
window.addEvent(elem, 'touchstart', _initDrag);
@ -175,7 +177,7 @@ var dragg = function(id) {
// Prevent default event
window.eventPreventDefault(e);
// Do not prapagate to other click event if dragged out
// Do not propagate to other click event if dragged out
if (dragged) {
e.stopImmediatePropagation();
}