guy 4 years ago
parent
commit
f1faa043ad
  1. 13
      src/base/single/editor/editor.textarea.js
  2. 4
      src/less/base/single/editor/editor.textarea.less

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

@ -86,7 +86,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
if (BI.isNotEmptyString(o.watermark)) {
if (!this.watermark) {
this.watermark = BI.createWidget({
type: "bi.text_button",
type: "bi.label",
cls: "bi-water-mark cursor-default textarea-watermark",
textAlign: "left",
whiteSpace: "normal",
@ -96,8 +96,15 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
hgap: 4,
vgap: 4
});
this.watermark.on(BI.TextButton.EVENT_CHANGE, function () {
self.focus();
this.watermark.element.bind({
mousedown: function (e) {
if (self.isEnabled()) {
self.editor.focus();
} else {
self.editor.blur();
}
e.stopEvent();
}
});
BI.createWidget({
type: "bi.absolute",

4
src/less/base/single/editor/editor.textarea.less

@ -10,8 +10,6 @@
& {
border: none;
}
// BI-86802 div构造的水印移上去没有输入状态的光标,让编辑框层级比水印高一点
z-index: 1;
}
& .textarea-watermark{
max-height: 100%;
@ -26,4 +24,4 @@
}
}
}
}
}

Loading…
Cancel
Save