|
|
|
@ -23,6 +23,7 @@ BI.Editor = BI.inherit(BI.Single, {
|
|
|
|
|
allowBlank: false, |
|
|
|
|
watermark: "", |
|
|
|
|
errorText: "", |
|
|
|
|
autoTrim: true, |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -49,25 +50,29 @@ BI.Editor = BI.inherit(BI.Single, {
|
|
|
|
|
margin: "0", |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
var items = [{ |
|
|
|
|
var items = [ |
|
|
|
|
{ |
|
|
|
|
el: { |
|
|
|
|
type: "bi.absolute", |
|
|
|
|
ref: function (_ref) { |
|
|
|
|
self.contentWrapper = _ref; |
|
|
|
|
}, |
|
|
|
|
items: [{ |
|
|
|
|
items: [ |
|
|
|
|
{ |
|
|
|
|
el: this.editor, |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
top: 0, |
|
|
|
|
bottom: 0, |
|
|
|
|
}], |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
left: o.hgap + o.lgap, |
|
|
|
|
right: o.hgap + o.rgap, |
|
|
|
|
top: o.vgap + o.tgap, |
|
|
|
|
bottom: o.vgap + o.bgap, |
|
|
|
|
}]; |
|
|
|
|
} |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
BI.createWidget({ |
|
|
|
|
type: "bi.absolute", |
|
|
|
@ -248,13 +253,15 @@ BI.Editor = BI.inherit(BI.Single, {
|
|
|
|
|
BI.createWidget({ |
|
|
|
|
type: "bi.absolute", |
|
|
|
|
element: this.contentWrapper, |
|
|
|
|
items: [{ |
|
|
|
|
items: [ |
|
|
|
|
{ |
|
|
|
|
el: this.watermark, |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
top: 0, |
|
|
|
|
bottom: 0, |
|
|
|
|
}], |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
this.watermark.setText(v); |
|
|
|
@ -265,7 +272,7 @@ BI.Editor = BI.inherit(BI.Single, {
|
|
|
|
|
var o = this.options; |
|
|
|
|
var errorText = o.errorText; |
|
|
|
|
if (BI.isFunction(errorText)) { |
|
|
|
|
errorText = errorText(BI.trim(this.editor.getValue())); |
|
|
|
|
errorText = errorText(o.autoTrim ? BI.trim(this.editor.getValue()) : this.editor.getValue()); |
|
|
|
|
} |
|
|
|
|
if (!this.disabledError && BI.isKey(errorText)) { |
|
|
|
|
BI.Bubbles[b ? "show" : "hide"](this.getName(), errorText, this, { |
|
|
|
@ -330,10 +337,10 @@ BI.Editor = BI.inherit(BI.Single, {
|
|
|
|
|
|
|
|
|
|
getValue: function () { |
|
|
|
|
if (!this.isValid()) { |
|
|
|
|
return BI.trim(this.editor.getLastValidValue()); |
|
|
|
|
return this.options.autoTrim ? BI.trim(this.editor.getLastValidValue()) : this.editor.getLastValidValue(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return BI.trim(this.editor.getValue()); |
|
|
|
|
return this.options.autoTrim ? BI.trim(this.editor.getValue()) : this.editor.getValue(); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
isEditing: function () { |
|
|
|
|