From 05f25f76573a993e061e9aeac1c70388a0b10bf5 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 26 Mar 2018 17:17:21 +0800 Subject: [PATCH] =?UTF-8?q?rich=5Feditor=E5=8F=AF=E4=BB=A5=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E6=98=AF=E5=90=A6=E5=8F=AA=E8=AF=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/bundle.js | 9 ++++++++- dist/case.js | 9 ++++++++- src/case/richeditor/niceditor/niceditor.js | 3 +++ src/case/richeditor/richeditor.js | 6 +++++- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/dist/bundle.js b/dist/bundle.js index 4252e40de..2a4f13f63 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -82239,6 +82239,9 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/** } else { console.error("不支持此浏览器"); } + if(o.readOnly) { + newInstance.disable(); + } return newInstance; }, @@ -83048,7 +83051,8 @@ BI.RichEditor = BI.inherit(BI.Widget, { this.editor = BI.createWidget({ type: "bi.nic_editor", width: o.width, - height: o.height + height: o.height, + readOnly: o.readOnly }); this.editor.on(BI.NicEditor.EVENT_BLUR, function () { @@ -83059,6 +83063,7 @@ BI.RichEditor = BI.inherit(BI.Widget, { type: "bi.combo", element: this, toggle: false, + trigger: o.readOnly ? "" : "click", direction: "top,left", isNeedAdjustWidth: false, isNeedAdjustHeight: false, @@ -83076,6 +83081,7 @@ BI.RichEditor = BI.inherit(BI.Widget, { }); this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW, function () { + self.fireEvent(BI.RichEditor.EVENT_AFTER_HIDEVIEW); }); }, @@ -83087,6 +83093,7 @@ BI.RichEditor = BI.inherit(BI.Widget, { return this.editor.getValue(); } }); +BI.RichEditor.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW"; BI.RichEditor.EVENT_CONFIRM = "EVENT_CONFIRM"; BI.shortcut("bi.rich_editor", BI.RichEditor);/** * 分段控件使用的button diff --git a/dist/case.js b/dist/case.js index 5582e2b01..c48c75ead 100644 --- a/dist/case.js +++ b/dist/case.js @@ -10297,6 +10297,9 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/** } else { console.error("不支持此浏览器"); } + if(o.readOnly) { + newInstance.disable(); + } return newInstance; }, @@ -11106,7 +11109,8 @@ BI.RichEditor = BI.inherit(BI.Widget, { this.editor = BI.createWidget({ type: "bi.nic_editor", width: o.width, - height: o.height + height: o.height, + readOnly: o.readOnly }); this.editor.on(BI.NicEditor.EVENT_BLUR, function () { @@ -11117,6 +11121,7 @@ BI.RichEditor = BI.inherit(BI.Widget, { type: "bi.combo", element: this, toggle: false, + trigger: o.readOnly ? "" : "click", direction: "top,left", isNeedAdjustWidth: false, isNeedAdjustHeight: false, @@ -11134,6 +11139,7 @@ BI.RichEditor = BI.inherit(BI.Widget, { }); this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW, function () { + self.fireEvent(BI.RichEditor.EVENT_AFTER_HIDEVIEW); }); }, @@ -11145,6 +11151,7 @@ BI.RichEditor = BI.inherit(BI.Widget, { return this.editor.getValue(); } }); +BI.RichEditor.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW"; BI.RichEditor.EVENT_CONFIRM = "EVENT_CONFIRM"; BI.shortcut("bi.rich_editor", BI.RichEditor);/** * 分段控件使用的button diff --git a/src/case/richeditor/niceditor/niceditor.js b/src/case/richeditor/niceditor/niceditor.js index 1e93f1f8f..8261c8416 100644 --- a/src/case/richeditor/niceditor/niceditor.js +++ b/src/case/richeditor/niceditor/niceditor.js @@ -38,6 +38,9 @@ } else { console.error("不支持此浏览器"); } + if(o.readOnly) { + newInstance.disable(); + } return newInstance; }, diff --git a/src/case/richeditor/richeditor.js b/src/case/richeditor/richeditor.js index 42ab26a8d..39c476340 100644 --- a/src/case/richeditor/richeditor.js +++ b/src/case/richeditor/richeditor.js @@ -18,7 +18,8 @@ BI.RichEditor = BI.inherit(BI.Widget, { this.editor = BI.createWidget({ type: "bi.nic_editor", width: o.width, - height: o.height + height: o.height, + readOnly: o.readOnly }); this.editor.on(BI.NicEditor.EVENT_BLUR, function () { @@ -29,6 +30,7 @@ BI.RichEditor = BI.inherit(BI.Widget, { type: "bi.combo", element: this, toggle: false, + trigger: o.readOnly ? "" : "click", direction: "top,left", isNeedAdjustWidth: false, isNeedAdjustHeight: false, @@ -46,6 +48,7 @@ BI.RichEditor = BI.inherit(BI.Widget, { }); this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW, function () { + self.fireEvent(BI.RichEditor.EVENT_AFTER_HIDEVIEW); }); }, @@ -57,5 +60,6 @@ BI.RichEditor = BI.inherit(BI.Widget, { return this.editor.getValue(); } }); +BI.RichEditor.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW"; BI.RichEditor.EVENT_CONFIRM = "EVENT_CONFIRM"; BI.shortcut("bi.rich_editor", BI.RichEditor); \ No newline at end of file