Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<Version>10.0.1</Version>
<Version>10.0.2</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public partial class Editor
public string? PlaceHolder { get; set; }

/// <summary>
/// 获得/设置 是否直接显示为富文本编辑框
/// 获得/设置 是否直接显示为富文本编辑框 默认 false
/// </summary>
[Parameter]
public bool IsEditor { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down
Loading