diff --git a/dist/bundle.js b/dist/bundle.js index fd421278c..4a34f6e95 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -82903,13 +82903,13 @@ BI.RichEditorAction = BI.inherit(BI.Widget, { self.key(e); } }); - o.editor.on(BI.NicEditor.EVENT_BLUR, function () { - self.setEnable(false); - }); - o.editor.on(BI.NicEditor.EVENT_KEYDOWN, BI.bind(this.keydown, this)); - if (o.used === false) { - this.setEnable(false); - } + // o.editor.on(BI.NicEditor.EVENT_BLUR, function () { + // self.setEnable(false); + // }); + // o.editor.on(BI.NicEditor.EVENT_KEYDOWN, BI.bind(this.keydown, this)); + // if (o.used === false) { + // this.setEnable(false); + // } }, checkNodes: function (e) { @@ -83272,9 +83272,12 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/** return; // return false; } + if (this.instance.checkToolbar(t)) { + return; + } } while (t = t.parentNode); this.fireEvent("blur", t); - this.lastSelectedInstance = this.selectedInstance; + this.lastSelectedInstance = this.selectedInstance || this.lastSelectedInstance; this.selectedInstance = null; // return false; }, @@ -83283,6 +83286,10 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/** this.instance.focus(); }, + bindToolbar: function (toolbar) { + this.instance.bindToolbar(toolbar); + }, + setValue: function (v) { this.instance.setContent(v); }, @@ -83291,6 +83298,10 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/** return this.instance.getContent(); }, + getInstance: function () { + return this.instance; + }, + destroyed: function () { $(document).unbind("mousedown." + this.getName()); } @@ -83529,6 +83540,14 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/** } }, + bindToolbar: function (toolbar) { + this.toolbar = toolbar; + }, + + checkToolbar: function (element) { + return this.toolbar && this.toolbar.element[0] === element; + }, + nicCommand: function (cmd, args) { document.execCommand(cmd, false, args); } diff --git a/dist/case.js b/dist/case.js index a17fad5c4..2d5456197 100644 --- a/dist/case.js +++ b/dist/case.js @@ -10403,13 +10403,13 @@ BI.RichEditorAction = BI.inherit(BI.Widget, { self.key(e); } }); - o.editor.on(BI.NicEditor.EVENT_BLUR, function () { - self.setEnable(false); - }); - o.editor.on(BI.NicEditor.EVENT_KEYDOWN, BI.bind(this.keydown, this)); - if (o.used === false) { - this.setEnable(false); - } + // o.editor.on(BI.NicEditor.EVENT_BLUR, function () { + // self.setEnable(false); + // }); + // o.editor.on(BI.NicEditor.EVENT_KEYDOWN, BI.bind(this.keydown, this)); + // if (o.used === false) { + // this.setEnable(false); + // } }, checkNodes: function (e) { @@ -10772,9 +10772,12 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/** return; // return false; } + if (this.instance.checkToolbar(t)) { + return; + } } while (t = t.parentNode); this.fireEvent("blur", t); - this.lastSelectedInstance = this.selectedInstance; + this.lastSelectedInstance = this.selectedInstance || this.lastSelectedInstance; this.selectedInstance = null; // return false; }, @@ -10783,6 +10786,10 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/** this.instance.focus(); }, + bindToolbar: function (toolbar) { + this.instance.bindToolbar(toolbar); + }, + setValue: function (v) { this.instance.setContent(v); }, @@ -10791,6 +10798,10 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/** return this.instance.getContent(); }, + getInstance: function () { + return this.instance; + }, + destroyed: function () { $(document).unbind("mousedown." + this.getName()); } @@ -11029,6 +11040,14 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/** } }, + bindToolbar: function (toolbar) { + this.toolbar = toolbar; + }, + + checkToolbar: function (element) { + return this.toolbar && this.toolbar.element[0] === element; + }, + nicCommand: function (cmd, args) { document.execCommand(cmd, false, args); } diff --git a/dist/fineui.js b/dist/fineui.js index bb455a3a2..f95091785 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -83152,13 +83152,13 @@ BI.RichEditorAction = BI.inherit(BI.Widget, { self.key(e); } }); - o.editor.on(BI.NicEditor.EVENT_BLUR, function () { - self.setEnable(false); - }); - o.editor.on(BI.NicEditor.EVENT_KEYDOWN, BI.bind(this.keydown, this)); - if (o.used === false) { - this.setEnable(false); - } + // o.editor.on(BI.NicEditor.EVENT_BLUR, function () { + // self.setEnable(false); + // }); + // o.editor.on(BI.NicEditor.EVENT_KEYDOWN, BI.bind(this.keydown, this)); + // if (o.used === false) { + // this.setEnable(false); + // } }, checkNodes: function (e) { @@ -83521,9 +83521,12 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/** return; // return false; } + if (this.instance.checkToolbar(t)) { + return; + } } while (t = t.parentNode); this.fireEvent("blur", t); - this.lastSelectedInstance = this.selectedInstance; + this.lastSelectedInstance = this.selectedInstance || this.lastSelectedInstance; this.selectedInstance = null; // return false; }, @@ -83532,6 +83535,10 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/** this.instance.focus(); }, + bindToolbar: function (toolbar) { + this.instance.bindToolbar(toolbar); + }, + setValue: function (v) { this.instance.setContent(v); }, @@ -83540,6 +83547,10 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/** return this.instance.getContent(); }, + getInstance: function () { + return this.instance; + }, + destroyed: function () { $(document).unbind("mousedown." + this.getName()); } @@ -83778,6 +83789,14 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/** } }, + bindToolbar: function (toolbar) { + this.toolbar = toolbar; + }, + + checkToolbar: function (element) { + return this.toolbar && this.toolbar.element[0] === element; + }, + nicCommand: function (cmd, args) { document.execCommand(cmd, false, args); } diff --git a/src/case/richeditor/bar/action.richeditor.js b/src/case/richeditor/bar/action.richeditor.js index d6673432b..be45fc2bc 100644 --- a/src/case/richeditor/bar/action.richeditor.js +++ b/src/case/richeditor/bar/action.richeditor.js @@ -24,13 +24,13 @@ BI.RichEditorAction = BI.inherit(BI.Widget, { self.key(e); } }); - o.editor.on(BI.NicEditor.EVENT_BLUR, function () { - self.setEnable(false); - }); - o.editor.on(BI.NicEditor.EVENT_KEYDOWN, BI.bind(this.keydown, this)); - if (o.used === false) { - this.setEnable(false); - } + // o.editor.on(BI.NicEditor.EVENT_BLUR, function () { + // self.setEnable(false); + // }); + // o.editor.on(BI.NicEditor.EVENT_KEYDOWN, BI.bind(this.keydown, this)); + // if (o.used === false) { + // this.setEnable(false); + // } }, checkNodes: function (e) { diff --git a/src/case/richeditor/niceditor/niceditor.js b/src/case/richeditor/niceditor/niceditor.js index add71afa6..2aee1abb6 100644 --- a/src/case/richeditor/niceditor/niceditor.js +++ b/src/case/richeditor/niceditor/niceditor.js @@ -65,9 +65,12 @@ return; // return false; } + if (this.instance.checkToolbar(t)) { + return; + } } while (t = t.parentNode); this.fireEvent("blur", t); - this.lastSelectedInstance = this.selectedInstance; + this.lastSelectedInstance = this.selectedInstance || this.lastSelectedInstance; this.selectedInstance = null; // return false; }, @@ -76,6 +79,10 @@ this.instance.focus(); }, + bindToolbar: function (toolbar) { + this.instance.bindToolbar(toolbar); + }, + setValue: function (v) { this.instance.setContent(v); }, @@ -84,6 +91,10 @@ return this.instance.getContent(); }, + getInstance: function () { + return this.instance; + }, + destroyed: function () { $(document).unbind("mousedown." + this.getName()); } @@ -322,6 +333,14 @@ } }, + bindToolbar: function (toolbar) { + this.toolbar = toolbar; + }, + + checkToolbar: function (element) { + return this.toolbar && this.toolbar.element[0] === element; + }, + nicCommand: function (cmd, args) { document.execCommand(cmd, false, args); }