diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-06-03 19:07:49 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-06-03 19:07:49 -0400 |
| commit | 142807d8ea506e792dd662ca67ad3a6d49659b57 (patch) | |
| tree | ef590093c0ad5c6187a5a31697efbf3959994a53 /js/tool.js | |
| parent | 6cb13ad54e3d807a181285fc7b1befa55b0bc264 (diff) | |
fix some weird focus issues
Diffstat (limited to 'js/tool.js')
| -rw-r--r-- | js/tool.js | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -9,6 +9,7 @@ var Tool = Model({ done: function(){}, focus: function(){ // focused && focused.blur() + console.log("focusing ", this.name) current_tool && current_tool.blur() current_tool = this this.span.classList.add('focused') @@ -17,6 +18,7 @@ var Tool = Model({ }, blur: function(){ current_tool = null + console.log("blurring ", this.name) this.span.classList.remove('focused') this.done() } @@ -37,15 +39,35 @@ var Checkbox = Tool.extend({ var BlurredCheckbox = Checkbox.extend({ focus: function(){ + if (current_tool.name == "shader") { + shader.toggle(false) + current_tool.blur() + current_tool = controls.circle + } this.use() if (this.name != 'shader' && is_desktop) { cursor_input.focus() } + }, + blur: function(){ + console.log("blurring ", this.name) + this.span.classList.remove('focused') + this.done() } }) var BlurredTool = Tool.extend({ focus: function(){ + if (current_tool.name == "shader") { + shader.toggle(false) + current_tool.blur() + current_tool = controls.circle + } this.use() if (this.name != 'shader' && is_desktop) { cursor_input.focus() } + }, + blur: function(){ + console.log("blurring ", this.name) + this.span.classList.remove('focused') + this.done() } }) |
