// Generated by CoffeeScript 1.10.0 (function() { var Toolbar, bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, hasProp = {}.hasOwnProperty; global(Toolbar = (function(superClass) { extend(Toolbar, superClass); function Toolbar(conf) { this.redraw = bind(this.redraw, this); Toolbar.__super__.constructor.call(this, conf); this.current_tool = conf.current_tool; this.tool_btns = {}; this.tool_btns['Arrow'] = this.d3el.append('button').text('Arrow tool').on('click', (function(_this) { return function() { return _this.current_tool.set('Arrow'); }; })(this)); this.tool_btns['Multiline'] = this.d3el.append('button').text('Multiline tool').on('click', (function(_this) { return function() { return _this.current_tool.set('Multiline'); }; })(this)); this.current_tool.on('change', this.redraw); } Toolbar.prototype.redraw = function() { return Object.keys(this.tool_btns).forEach((function(_this) { return function(tool_name) { return _this.tool_btns[tool_name].classed('selected', tool_name === _this.current_tool.get()); }; })(this)); }; return Toolbar; })(View)); }).call(this);