(function() { var 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; Backbone.Poised.LinkedNumberControl = (function(superClass) { extend(LinkedNumberControl, superClass); function LinkedNumberControl() { this.render = bind(this.render, this); this.initialize = bind(this.initialize, this); return LinkedNumberControl.__super__.constructor.apply(this, arguments); } LinkedNumberControl.prototype.initialize = function(options) { var ref, ref1; if (options == null) { options = {}; } LinkedNumberControl.__super__.initialize.apply(this, arguments); this.options = _.chain(options).pick('clearOnFocus', 'stepSize', 'precision', 'range', 'attribute', 'unit', 'minValue', 'maxValue').defaults({ clearOnFocus: true, type: 'number', minValue: _.firstDefined(options.minValue, (ref = options.range) != null ? ref[0] : void 0), maxValue: _.firstDefined(options.maxValue, (ref1 = options.range) != null ? ref1[1] : void 0), parentView: this }).value(); if ((this.options.stepSize != null) && (this.options.precision == null)) { return this.options.precision = _.find([0, 1, 2, 3], (function(_this) { return function(i) { return _this.options.stepSize * Math.pow(10, i) >= 1; }; })(this)); } }; LinkedNumberControl.prototype.render = function() { LinkedNumberControl.__super__.render.apply(this, arguments); this.subviews.spinner1 = new Backbone.Poised.Textfield(_.defaults({ model: this.model1 }, this.options)); this.$control1.append(this.subviews.spinner1.render().el); this.subviews.spinner2 = new Backbone.Poised.Textfield(_.defaults({ model: this.model2 }, this.options)); this.$control2.append(this.subviews.spinner2.render().el); return this; }; return LinkedNumberControl; })(Backbone.Poised.LinkedControl); }).call(this);