diff --git a/src/components/BootstrapBlazor.SummerNote/BootstrapBlazor.SummerNote.csproj b/src/components/BootstrapBlazor.SummerNote/BootstrapBlazor.SummerNote.csproj index 6abcc953..992de3d2 100644 --- a/src/components/BootstrapBlazor.SummerNote/BootstrapBlazor.SummerNote.csproj +++ b/src/components/BootstrapBlazor.SummerNote/BootstrapBlazor.SummerNote.csproj @@ -1,7 +1,7 @@ - 10.0.1 + 10.0.2 diff --git a/src/components/BootstrapBlazor.SummerNote/Components/Editor/Editor.razor.cs b/src/components/BootstrapBlazor.SummerNote/Components/Editor/Editor.razor.cs index ce6d38cf..b22c06c8 100644 --- a/src/components/BootstrapBlazor.SummerNote/Components/Editor/Editor.razor.cs +++ b/src/components/BootstrapBlazor.SummerNote/Components/Editor/Editor.razor.cs @@ -32,7 +32,7 @@ public partial class Editor public string? PlaceHolder { get; set; } /// - /// 获得/设置 是否直接显示为富文本编辑框 + /// 获得/设置 是否直接显示为富文本编辑框 默认 false /// [Parameter] public bool IsEditor { get; set; } diff --git a/src/components/BootstrapBlazor.SummerNote/Components/Editor/Editor.razor.js b/src/components/BootstrapBlazor.SummerNote/Components/Editor/Editor.razor.js index f925dad6..d4ad2219 100644 --- a/src/components/BootstrapBlazor.SummerNote/Components/Editor/Editor.razor.js +++ b/src/components/BootstrapBlazor.SummerNote/Components/Editor/Editor.razor.js @@ -3,10 +3,6 @@ import { addLink, addScript } from '../../../BootstrapBlazor/modules/utility.js' import Data from '../../../BootstrapBlazor/modules/data.js' import EventHandler from '../../../BootstrapBlazor/modules/event-handler.js' -if (window.BootstrapBlazor === void 0) { - window.BootstrapBlazor = {}; -} - export async function init(id, invoker, methodGetPluginAttrs, methodClickPluginItem, height, value, lang, langUrl, hasUpload) { const el = document.getElementById(id) if (el === null) { @@ -45,7 +41,6 @@ export async function init(id, invoker, methodGetPluginAttrs, methodClickPluginI const showSubmit = el.getAttribute("data-bb-submit") === "true" option.toolbar = toolbar; - reloadCallbacks(id, option); if (hasUpload) { option.callbacks.onImageUpload = async files => { editor.files = files @@ -142,23 +137,6 @@ export async function init(id, invoker, methodGetPluginAttrs, methodClickPluginI await initEditor(); } -const reloadCallbacks = (id, option) => { - const events = ['Blur', 'BlurCodeview', 'Change', 'ChangeCodeview', 'DialogShown', 'Enter', 'Focus', 'ImageUpload', 'ImageLinkInsert', 'ImageUploadError', 'Init', 'Keydown', 'Keyup', 'Mousedown', 'Mouseup', 'Paste', 'Scroll']; - - const callbacks = window.BootstrapBlazor?.SummerNote?.callbacks; - const cb = callbacks?.find(i => i.id === id); - if (cb) { - events.forEach(event => { - const method = cb[`on${event}`]; - if (method) { - option.callbacks[`on${event}`] = function () { - method.apply(this, arguments); - }; - } - }); - } -} - export function update(id, val) { const editor = Data.get(id) if (editor.$editor) {