summaryrefslogtreecommitdiff
path: root/js/app.js
diff options
context:
space:
mode:
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')
})