summaryrefslogtreecommitdiff
path: root/js/tool.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2014-11-21 13:33:20 -0500
committerJules Laplace <jules@okfoc.us>2014-11-21 13:33:20 -0500
commitfea42b1513e321b6c397c914327a9a4a7d96e331 (patch)
tree0c52449d5e53fc60c30d06f75a0e7b6f9a3bd608 /js/tool.js
parent9546cd5705e723e4c39ad4b34f0e154b8ab5e904 (diff)
split up js and style a little
Diffstat (limited to 'js/tool.js')
-rw-r--r--js/tool.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/js/tool.js b/js/tool.js
new file mode 100644
index 0000000..3b9b803
--- /dev/null
+++ b/js/tool.js
@@ -0,0 +1,16 @@
+function Tool (span) {
+ this.lex = new Lex (span)
+ this.span = span
+}
+Tool.prototype.use = function(){}
+Tool.prototype.focus = function(){
+ focused && focused.blur()
+ current_tool && current_tool.blur()
+ current_tool = this
+ this.span.classList.add('focused')
+ this.use()
+}
+Tool.prototype.blur = function(){
+ current_tool = null
+ this.span.classList.remove('focused')
+}