|
发表于 2017-1-16 16:38:31
|
显示全部楼层
/UI2/system/components/justep/richTextarea/richTextarea.js文件中
- doChange : function() {
- var editor = this.getEditor();
- if(editor){
- //解决editor的getContent方法自动追加<p>问题---遗留问题当原值为"text"时赋值后会变成"<p>text</p>触发valueChange"
- var val = editor.getPlainTxt();
- var refVal = justep.Bind.isObservable(this.ref) ? this.ref.get() : (this.ref instanceof justep.BindComponent.NullValue?"":this.ref);
- if(val!=refVal && (val!=='' || (refVal!==undefined && refVal!==null))){
- this.fireEvent('onChange', {
- 'source' : this,
- 'value' : editor.getContent()
- });
- this.val2ref();
- }
- }
- },
复制代码
改为
- doChange : function() {
- var editor = this.getEditor();
- if(editor){
- //解决editor的getContent方法自动追加<p>问题---遗留问题当原值为"text"时赋值后会变成"<p>text</p>触发valueChange"
- var val = editor.getContentLength()>0?editor.getPlainTxt():'';
- var refVal = justep.Bind.isObservable(this.ref) ? this.ref.get() : (this.ref instanceof justep.BindComponent.NullValue?"":this.ref);
- if(val!=refVal && (val!=='' || (refVal!==undefined && refVal!==null))){
- this.fireEvent('onChange', {
- 'source' : this,
- 'value' : editor.getContent()
- });
- this.val2ref();
- }
- }
- },
复制代码
修改后参考http://docs.wex5.com/bex5-ui-question-list-10013/处理 |
|