(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.StringControl = (function(superClass) { extend(StringControl, superClass); function StringControl() { this.render = bind(this.render, this); return StringControl.__super__.constructor.apply(this, arguments); } StringControl.prototype.initialize = function(options) { if (options == null) { options = {}; } StringControl.__super__.initialize.apply(this, arguments); return this.options = _.chain(options).pick('model', 'attribute', 'rows', 'placeholder').defaults({ type: 'text', placeholder: null, rows: 1 }).value(); }; StringControl.prototype.render = function() { StringControl.__super__.render.apply(this, arguments); if (this.options.rows > 1) { this.subviews.textarea = new Backbone.Poised.Textarea(this.options); this.$el.append(this.subviews.textarea.render().el); } else { this.subviews.textfield = new Backbone.Poised.Textfield(this.options); this.$input.html(this.subviews.textfield.render().el); } return this; }; return StringControl; })(Backbone.Poised.BaseControl); }).call(this);