summaryrefslogtreecommitdiff
path: root/js/app.js
diff options
context:
space:
mode:
authortimb <opuscule@gmail.com>2015-07-11 07:09:33 -0700
committertimb <opuscule@gmail.com>2015-07-11 07:09:33 -0700
commit85a2862b92abc75a65ca79e55fb987a1af4bd337 (patch)
tree95e436f850b7347ee9d02bbd0da845bce81dbc56 /js/app.js
parent600f28f73e13f5351f870833a0fd0dccba51afed (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.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/js/app.js b/js/app.js
index a98ee84..f73a447 100644
--- a/js/app.js
+++ b/js/app.js
@@ -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')
})