From 13394e3898c65d027606f5d4c1e285fdc118c8a2 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 3 Jun 2015 13:16:07 -0400 Subject: better mobile support --- js/app.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'js/app.js') diff --git a/js/app.js b/js/app.js index 3545734..d65f239 100644 --- a/js/app.js +++ b/js/app.js @@ -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') }) -- cgit v1.2.3-70-g09d2