summaryrefslogtreecommitdiff
path: root/js/tool.js
blob: 3b9b803b8be1c7d8ac4bbc138ae0ab7241cd90f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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')
}