From 3b1267b1938772edd920ee8fc64809d33af85a36 Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 14 Jun 2022 13:52:47 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=97=A0JIRA=20editor=E7=9A=84watermark?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5set=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/editor/editor.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/base/single/editor/editor.js b/src/base/single/editor/editor.js index 364044c1b..328adf71d 100644 --- a/src/base/single/editor/editor.js +++ b/src/base/single/editor/editor.js @@ -239,10 +239,11 @@ BI.Editor = BI.inherit(BI.Single, { return this.options.errorText; }, + setWatermark: function (v) { + this.setWaterMark(v); + }, + setWaterMark: function (v) { - if (!BI.isKey(v)) { - return; - } this.options.watermark = v; From 02b17bac47881b8f0baeb131c14861fdcbf5fd3b Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 14 Jun 2022 13:54:52 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=97=A0JIRA=20editor=E7=9A=84watermark?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5set=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/editor/editor.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/base/single/editor/editor.js b/src/base/single/editor/editor.js index 328adf71d..5322124d9 100644 --- a/src/base/single/editor/editor.js +++ b/src/base/single/editor/editor.js @@ -239,10 +239,6 @@ BI.Editor = BI.inherit(BI.Single, { return this.options.errorText; }, - setWatermark: function (v) { - this.setWaterMark(v); - }, - setWaterMark: function (v) { this.options.watermark = v; From 9923a814981e778d51f408cc76caead284925524 Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 14 Jun 2022 14:14:23 +0800 Subject: [PATCH 3/3] =?UTF-8?q?KERNEL-10932=20feat:=20editor=E6=94=AF?= =?UTF-8?q?=E6=8C=81value=E5=93=8D=E5=BA=94=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/editor/editor.clear.js | 5 ++++- src/case/editor/editor.shelter.js | 5 ++++- src/case/editor/editor.sign.js | 7 +++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/case/editor/editor.clear.js b/src/case/editor/editor.clear.js index 253d32431..6fd199a43 100644 --- a/src/case/editor/editor.clear.js +++ b/src/case/editor/editor.clear.js @@ -17,8 +17,11 @@ BI.ClearEditor = BI.inherit(BI.Widget, { }); }, _init: function () { - BI.ClearEditor.superclass._init.apply(this, arguments); var self = this, o = this.options; + o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) { + self.setValue(newValue); + }) : o.value; + BI.ClearEditor.superclass._init.apply(this, arguments); this.editor = BI.createWidget({ type: "bi.editor", simple: o.simple, diff --git a/src/case/editor/editor.shelter.js b/src/case/editor/editor.shelter.js index dec410d87..39def9d77 100644 --- a/src/case/editor/editor.shelter.js +++ b/src/case/editor/editor.shelter.js @@ -26,8 +26,11 @@ BI.ShelterEditor = BI.inherit(BI.Widget, { }, _init: function () { - BI.ShelterEditor.superclass._init.apply(this, arguments); var self = this, o = this.options; + o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) { + self.setValue(newValue); + }) : o.value; + BI.ShelterEditor.superclass._init.apply(this, arguments); this.editor = BI.createWidget({ type: "bi.editor", simple: o.simple, diff --git a/src/case/editor/editor.sign.js b/src/case/editor/editor.sign.js index 28f1ab1cf..330c31dfe 100644 --- a/src/case/editor/editor.sign.js +++ b/src/case/editor/editor.sign.js @@ -26,8 +26,11 @@ BI.SignEditor = BI.inherit(BI.Widget, { }, _init: function () { - BI.SignEditor.superclass._init.apply(this, arguments); var self = this, o = this.options; + o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) { + self.setValue(newValue); + }) : o.value; + BI.SignEditor.superclass._init.apply(this, arguments); this.editor = BI.createWidget({ type: "bi.editor", simple: o.simple, @@ -279,4 +282,4 @@ BI.SignEditor.EVENT_RESTRICT = "EVENT_RESTRICT"; BI.SignEditor.EVENT_SPACE = "EVENT_SPACE"; BI.SignEditor.EVENT_EMPTY = "EVENT_EMPTY"; -BI.shortcut("bi.sign_editor", BI.SignEditor); \ No newline at end of file +BI.shortcut("bi.sign_editor", BI.SignEditor);