summaryrefslogtreecommitdiff
path: root/js/ui
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-06-03 19:07:49 -0400
committerJules Laplace <jules@okfoc.us>2015-06-03 19:07:49 -0400
commit142807d8ea506e792dd662ca67ad3a6d49659b57 (patch)
treeef590093c0ad5c6187a5a31697efbf3959994a53 /js/ui
parent6cb13ad54e3d807a181285fc7b1befa55b0bc264 (diff)
fix some weird focus issues
Diffstat (limited to 'js/ui')
-rw-r--r--js/ui/controls.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/js/ui/controls.js b/js/ui/controls.js
index 6a6c005..81a40e0 100644
--- a/js/ui/controls.js
+++ b/js/ui/controls.js
@@ -136,7 +136,7 @@ var controls = (function(){
//
- ShaderTool = Tool.extend({
+ var ShaderTool = Tool.extend({
active: false,
use: function(state){
this.active = typeof state == "boolean" ? state : ! this.active
@@ -148,7 +148,11 @@ var controls = (function(){
shader_rapper.style.display = "none"
}
},
- })
+ done: function(){
+ this.use(false)
+ console.log("shader done")
+ }
+ })
controls.shader = new ShaderTool (shader_el)
shader_textarea.value = demo_shader.innerHTML
shader_textarea.addEventListener("input", function(){
@@ -159,6 +163,8 @@ var controls = (function(){
controls.animate.use = function(state){
var state = shader.toggle()
this.update(state)
+ controls.shader.focus()
+ controls.shader.use(true)
}
controls.experimental_palette = new HiddenCheckbox (experimental_palette_toggle)