diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-07-13 07:43:19 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-07-13 07:43:19 -0400 |
| commit | 9a45b4474fc906c698c7cb39b60e22c0132716bb (patch) | |
| tree | 92c725365f46096ba0dc97c912bf66fa1a40547b /js/app.js | |
| parent | 72a690a40dd1727065e28b1ce0bca743283f54c7 (diff) | |
| parent | 5cc0340723278a1b8f39a6c46b8cf3201f47ec50 (diff) | |
Merge branch 'master' of lmno:ascii
Diffstat (limited to 'js/app.js')
| -rw-r--r-- | js/app.js | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -7,7 +7,8 @@ var filling = false var changed = false var focused -var canvas, tools, palette, controls, brush, mode, current_tool, current_canvas +var canvas, tools, palette, controls, brush, mode +var current_tool, current_filetool, current_canvas function init () { build() @@ -44,9 +45,16 @@ function bind () { window.addEventListener('mouseup', function(e){ dragging = erasing = false - if (current_tool.name != 'shader' && current_tool.name != 'load' && current_tool.name != 'save' && is_desktop) { + // if (current_filetool.name != 'shader' && current_filetool.name != 'load' && current_filetool.name != 'save' && is_desktop) { + // cursor_input.focus() + // } + + var ae = document.activeElement + + if (ae !== shader_textarea && ae !== import_textarea) { cursor_input.focus() } + if (selecting) { selection.up(e) } @@ -56,11 +64,11 @@ function bind () { }) window.addEventListener('mousedown', function(e){ - if (current_tool.name != 'shader' && is_desktop) { cursor_input.focus() } + // if (current_filetool.name != 'shader' && is_desktop) { cursor_input.focus() } }) document.addEventListener('DOMContentLoaded', function(){ - if (current_tool.name != 'shader' && is_desktop) { cursor_input.focus() } + if (is_desktop) { cursor_input.focus() } document.body.classList.remove('loading') }) |
