Skip to content

Commit

Permalink
- update list touch&click workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
vanhoavn committed Jul 15, 2020
1 parent 9f2c9c3 commit e4dbe3a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ android {
applicationId "vn.vhn.vsc"
minSdkVersion 24
targetSdkVersion 28
versionCode 10
versionName "1.1.08"
versionCode 12
versionName "1.1.09"

externalNativeBuild {
ndkBuild {
Expand Down
10 changes: 8 additions & 2 deletions app/src/main/java/vn/vhn/vhscode/CodeServerService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -297,18 +297,24 @@ class CodeServerService : Service() {
var ev = document.createEvent ('MouseEvents');
ev.initEvent ('mouseup', true, true);
e.dispatchEvent(ev);
ev = document.createEvent ('MouseEvents');
ev.initEvent ('click', true, true);
e.dispatchEvent(ev);
};
document.body.addEventListener('click', ()=>{click2=false;});
document.body.addEventListener('touchstart', clickTimer);
document.body.addEventListener('touchmove', ()=>{click=false;});
const classLists = [
'monaco-list-row',
'monaco-select-box'
];
document.body.addEventListener('touchend', (e) =>{
var node = e.target;
if(node) {
if(node.classList.contains('monaco-list-row')) {
if(classLists.some(x=>node.classList.contains(x))) {
dispatchMouseUp(node);
return;
} else if(node.parentNode && node.parentNode.classList.contains('monaco-list-row')) {
} else if(node.parentNode && classLists.every(x=>node.parentNode.classList.contains(x))) {
dispatchMouseUp(node.parentNode);
return;
}
Expand Down

0 comments on commit e4dbe3a

Please sign in to comment.