Skip to content

Commit 8a2490e

Browse files
committed
Reorganize code
1 parent b82f765 commit 8a2490e

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

Source/Extensions/Blazorise.RichTextEdit/wwwroot/richtextedit.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,6 @@ export function initialize(dotnetAdapter, element, elementId, options) {
3737
theme: options.theme
3838
};
3939

40-
if(options.useTables === true) {
41-
Quill.register({ 'modules/table-better': QuillTableBetter }, true);
42-
quillOptions.modules['table-better'] = {
43-
toolbarTable: true
44-
};
45-
quillOptions.modules.keyboard = {
46-
bindings: QuillTableBetter.keyboardBindings
47-
};
48-
}
49-
5040
if (options.submitOnEnter === true) {
5141
quillOptions.modules.keyboard = {
5242
bindings: {
@@ -65,8 +55,21 @@ export function initialize(dotnetAdapter, element, elementId, options) {
6555
};
6656
}
6757

68-
if (options.useResize) {
58+
if (options.useTables === true) {
59+
Quill.register({ 'modules/table-better': QuillTableBetter }, true);
60+
61+
quillOptions.modules['table-better'] = {
62+
toolbarTable: true
63+
};
64+
65+
quillOptions.modules.keyboard = {
66+
bindings: QuillTableBetter.keyboardBindings
67+
};
68+
}
69+
70+
if (options.useResize === true) {
6971
Quill.register({ 'modules/resize': QuillResize }, true);
72+
7073
quillOptions.modules.resize = {
7174
tools: [
7275
"left",

0 commit comments

Comments
 (0)