diff options
author | sun6eal <jacob.sun.meta@gmail.com> | 2019-05-09 09:28:14 +0300 |
---|---|---|
committer | sun6eal <jacob.sun.meta@gmail.com> | 2019-05-09 09:28:14 +0300 |
commit | b5d028b47c141bb70262e5d43235c7f3f93a2dbf (patch) | |
tree | 90397d2cf5f388aed549fdbe0c0552b478a29b4a /static | |
parent | 63ad84169131d215813cb2b539bc6c30ea93a3f6 (diff) |
make resize more easily on mobile
Diffstat (limited to 'static')
-rw-r--r-- | static/js/ziox.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/static/js/ziox.js b/static/js/ziox.js index fb190a6..40c8e9c 100644 --- a/static/js/ziox.js +++ b/static/js/ziox.js @@ -43,7 +43,7 @@ document.body.addEventListener('mousedown', e => { } }) document.body.addEventListener('touchstart', e => { - state.resizing = canResize(e.touches[0].clientX) + state.resizing = canResize(e.touches[0].clientX, 10) }) document.body.addEventListener('touchmove', e => { if (state.resizing) { @@ -72,8 +72,8 @@ function switchCursor () { } } -function canResize (x) { - return Math.abs(x - pane.getBoundingClientRect().right) <= 4 +function canResize (x, threshold = 4) { + return Math.abs(x - pane.getBoundingClientRect().right) <= threshold } function resize (x) { |