Browse Source

Fix trait select rendering

pull/79/merge
Artur Arseniev 10 years ago
parent
commit
ab78c8f044
  1. 16
      dist/grapes.min.js
  2. 17
      src/trait_manager/view/TraitSelectView.js

16
dist/grapes.min.js

File diff suppressed because one or more lines are too long

17
src/trait_manager/view/TraitSelectView.js

@ -16,12 +16,13 @@ define(['backbone','./TraitView'],
* @private
*/
getInputEl: function() {
if(!this.$input){
if(!this.$input) {
var md = this.model;
var opts = md.get('options') || [];
this.input = '<select>';
if(opts.length){
_.each(opts, function(el){
var input = '<select>';
if (opts.length) {
_.each(opts, function(el) {
var name, value, style;
var attrs = '';
if(typeof el === 'string'){
@ -33,10 +34,12 @@ define(['backbone','./TraitView'],
style = el.style ? el.style.replace(/"/g,'&quot;') : '';
attrs += style ? 'style="' + style + '"' : '';
}
this.input += '<option value="' + value + '" ' + attrs + '>' + name + '</option>';
}, this);
input += '<option value="' + value + '" ' + attrs + '>' + name + '</option>';
});
}
this.input += '</select>';
input += '</select>';
this.input = input;
this.$input = $(this.input);
var target = this.target;

Loading…
Cancel
Save