diff options
| author | timb <opuscule@gmail.com> | 2015-07-11 07:09:33 -0700 |
|---|---|---|
| committer | timb <opuscule@gmail.com> | 2015-07-11 07:09:33 -0700 |
| commit | 85a2862b92abc75a65ca79e55fb987a1af4bd337 (patch) | |
| tree | 95e436f850b7347ee9d02bbd0da845bce81dbc56 /js/app.js | |
| parent | 600f28f73e13f5351f870833a0fd0dccba51afed (diff) | |
make current_filetool (shader, load, save, etc) operate independent of current_tool (brush, fill, etc)
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') }) |
