BoundSelect = BoundControl.extend({ //el: false, //model: false, //attribute: false, //binder: false, message: false, placeholder: false, init: function(params) { for (var thing in params) this[thing] = params[thing]; this.el = this.el ? this.el : this.model.name.toLowerCase() + '_' + this.model.id + '_' + this.attribute.name; this.message = this.el + '_message'; this.placeholder = this.el + '_placeholder'; $('#'+this.el).wrap($('
') .attr('id', this.el + '_container') .css('position', 'relative') ); $('#'+this.el+'_container').empty(); if (this.attribute.fixed_placeholder) { $('#'+this.el+'_container').append($('
') .attr('id', this.placeholder) .addClass('placeholder') .append($('') .html(this.attribute.nice_name + ': ') ) ); } $('#'+this.el+'_container').append($('') .attr('id', this.el) .attr('placeholder', this.attribute.empty_text) .on('focus', function() { this2.edit(); }) .val(this.attribute.text.length > 0 ? this.attribute.text : this.attribute.empty_text) ); if (this.attribute.width) $('#'+this.el).css('width', this.attribute.width); if (this.attribute.fixed_placeholder) { var w = $('#'+this.placeholder).outerWidth(); $('#'+this.el) .css('padding-left', '+=' + w) .css('width', '-=' + w); } var this2 = this; this.attribute.populate_options(function() { var select = $('