diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-06-03 13:16:07 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-06-03 13:16:07 -0400 |
| commit | 13394e3898c65d027606f5d4c1e285fdc118c8a2 (patch) | |
| tree | 6f2617dae9f9ec6b7cd88485368246e873eca2bb /js/app.js | |
| parent | 11c4ee585e53dc28f844c01d14953446f8ff80a8 (diff) | |
better mobile support
Diffstat (limited to 'js/app.js')
| -rw-r--r-- | js/app.js | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -36,28 +36,30 @@ function build () { function bind () { canvas.bind() palette.bind() - letters.bind() + letters.bind() brush.bind() controls.bind() keys.bind() window.addEventListener('mouseup', function(e){ dragging = erasing = false - if (current_tool.name != 'shader' && current_tool.name != 'load' && current_tool.name != 'save') { + if (current_tool.name != 'shader' && current_tool.name != 'load' && current_tool.name != 'save' && is_desktop) { cursor_input.focus() } if (selecting) { selection.up(e) } }) + window.addEventListener("touchend", function(){ + dragging = false + }) window.addEventListener('mousedown', function(e){ - if (current_tool.name == "shader") { return } - cursor_input.focus() + if (current_tool.name != 'shader' && is_desktop) { cursor_input.focus() } }) document.addEventListener('DOMContentLoaded', function(){ - if (current_tool.name != 'shader') { cursor_input.focus() } + if (current_tool.name != 'shader' && is_desktop) { cursor_input.focus() } document.body.classList.remove('loading') }) |
