diff options
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() } }) |
