Browse Source

Update trait view

pull/36/head
Artur Arseniev 10 years ago
parent
commit
78f1de416d
  1. 2
      src/rich_text_editor/config/config.js
  2. 9
      src/trait_manager/view/TraitView.js

2
src/rich_text_editor/config/config.js

@ -24,7 +24,7 @@ define(function () {
command: 'insertHTML', command: 'insertHTML',
title: 'Link', title: 'Link',
class: 'fa fa-link', class: 'fa fa-link',
args: '<a href="">${content}</a>', args: '<a class="link" href="">${content}</a>',
}/*,{ }/*,{
command: 'fontSize', command: 'fontSize',
options: [ options: [

9
src/trait_manager/view/TraitView.js

@ -75,14 +75,17 @@ define(['backbone'], function (Backbone) {
getInputEl: function() { getInputEl: function() {
if(!this.$input){ if(!this.$input){
var md = this.model; var md = this.model;
var trg = this.target;
var name = md.get('name'); var name = md.get('name');
var opts = { var opts = {
placeholder: md.get('placeholder') || md.get('default'), placeholder: md.get('placeholder') || md.get('default'),
type: md.get('type') || 'text', type: md.get('type') || 'text'
value: md.get('value')
}; };
if(md.get('changeProp')){ if(md.get('changeProp')){
opts.value = this.target.get(name); opts.value = trg.get(name);
}else{
var attrs = trg.get('attributes');
opts.value = md.get('value') || attrs[name];
} }
if(md.get('min')) if(md.get('min'))
opts.min = md.get('min'); opts.min = md.get('min');

Loading…
Cancel
Save