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