touch drag offset calculation fix : scrollTop & Left is taken into account (scrolling parents elements must be positioned)
restore chrome --touch-event switch
This commit is contained in:
parent
bbf7440417
commit
5289f74c67
4 changed files with 9 additions and 7 deletions
|
|
@ -1,6 +1,7 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
|
||||
<link rel="stylesheet" href="fonts/font-awesome.min.css"/>
|
||||
<link rel="stylesheet" href="css/style.css"/>
|
||||
<script>
|
||||
|
|
|
|||
|
|
@ -43,18 +43,18 @@
|
|||
}
|
||||
|
||||
function getOffset(obj) {
|
||||
var offsetLeft = 0;
|
||||
var offsetTop = 0;
|
||||
var offsetLeft = 0
|
||||
var offsetTop = 0
|
||||
do {
|
||||
if (!isNaN(obj.offsetLeft)) {
|
||||
offsetLeft += obj.offsetLeft;
|
||||
offsetLeft += obj.offsetLeft - obj.scrollLeft
|
||||
}
|
||||
if (!isNaN(obj.offsetTop)) {
|
||||
offsetTop += obj.offsetTop;
|
||||
offsetTop += obj.offsetTop - obj.scrollTop
|
||||
}
|
||||
} while(obj = obj.offsetParent );
|
||||
} while(obj = obj.offsetParent )
|
||||
|
||||
return {left: offsetLeft, top: offsetTop};
|
||||
return {left: offsetLeft, top: offsetTop}
|
||||
}
|
||||
|
||||
element.on("touchstart.drag mousedown.drag", function(e) {
|
||||
|
|
|
|||
|
|
@ -721,6 +721,7 @@ form {
|
|||
height:100%;
|
||||
padding:6rem 0;
|
||||
overflow: auto;
|
||||
position: relative;
|
||||
> .widget {
|
||||
border:0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ compileScss = function(){
|
|||
}
|
||||
}
|
||||
|
||||
// app.commandLine.appendSwitch('--touch-events')
|
||||
app.commandLine.appendSwitch('--touch-events')
|
||||
|
||||
|
||||
app.on('window-all-closed', function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue