mirror of
https://github.com/YunoHost/SSOwat.git
synced 2024-09-03 20:06:27 +02:00
Fix regression on mobile: overlay not clickable
This commit is contained in:
parent
d3b267107f
commit
8e4a7ba80e
1 changed files with 6 additions and 4 deletions
|
@ -123,9 +123,6 @@ var dragg = function(id) {
|
||||||
this.x_elem = 0, this.y_elem = 0; // Stores top, left values (edge) of the element
|
this.x_elem = 0, this.y_elem = 0; // Stores top, left values (edge) of the element
|
||||||
|
|
||||||
var _initDrag = function(e){
|
var _initDrag = function(e){
|
||||||
// Prevent firefox native D'n'D behavior
|
|
||||||
window.eventPreventDefault(e);
|
|
||||||
|
|
||||||
if (e.type === "touchstart"){
|
if (e.type === "touchstart"){
|
||||||
x_pos = e.touches[0].clientX;
|
x_pos = e.touches[0].clientX;
|
||||||
y_pos = e.touches[0].clientY;
|
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
|
// Start dragging
|
||||||
window.addEvent(elem, 'mousedown', _initDrag);
|
window.addEvent(elem, 'mousedown', _initDrag);
|
||||||
window.addEvent(elem, 'touchstart', _initDrag);
|
window.addEvent(elem, 'touchstart', _initDrag);
|
||||||
|
@ -175,7 +177,7 @@ var dragg = function(id) {
|
||||||
// Prevent default event
|
// Prevent default event
|
||||||
window.eventPreventDefault(e);
|
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) {
|
if (dragged) {
|
||||||
e.stopImmediatePropagation();
|
e.stopImmediatePropagation();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue