Browse Source

DEC-16252 fix : bi.editor水印的间距与sign_editor,shilter_editro 等其他editor的text一致

es6
zsmj1994 4 years ago
parent
commit
44137f7e9a
  1. 13
      src/base/single/editor/editor.js

13
src/base/single/editor/editor.js

@ -53,7 +53,7 @@ BI.Editor = BI.inherit(BI.Single, {
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: [{
@ -183,14 +183,15 @@ BI.Editor = BI.inherit(BI.Single, {
} }
}, },
_assertWaterMark: function() { _assertWaterMark: function () {
var self = this, o = this.options; var self = this, o = this.options;
if(BI.isNull(this.watermark)) { if (BI.isNull(this.watermark)) {
this.watermark = BI.createWidget({ this.watermark = BI.createWidget({
type: "bi.label", type: "bi.label",
cls: "bi-water-mark", cls: "bi-water-mark",
text: this.options.watermark, text: this.options.watermark,
height: o.height - 2 * o.vgap - o.tgap, height: o.height - 2 * o.vgap - o.tgap,
hgap: o.hgap - 2,
whiteSpace: "nowrap", whiteSpace: "nowrap",
textAlign: "left" textAlign: "left"
}); });
@ -237,7 +238,7 @@ BI.Editor = BI.inherit(BI.Single, {
return this.options.errorText; return this.options.errorText;
}, },
setWaterMark: function(v) { setWaterMark: function (v) {
if (!BI.isKey(v)) { if (!BI.isKey(v)) {
return; return;
} }
@ -251,8 +252,8 @@ BI.Editor = BI.inherit(BI.Single, {
element: this.contentWrapper, element: this.contentWrapper,
items: [{ items: [{
el: this.watermark, el: this.watermark,
left: this.options.hgap, left: 0,
right: this.options.hgap, right: 0,
top: 0, top: 0,
bottom: 0, bottom: 0,
}], }],

Loading…
Cancel
Save