mirror of
https://github.com/logos-co/open-law.git
synced 2025-01-27 07:05:06 +00:00
29 lines
708 B
TypeScript
29 lines
708 B
TypeScript
const Quill = require('./quill');
|
|
|
|
export function initQuill() {
|
|
var toolbarOptions = [
|
|
['bold', 'italic', 'underline'],
|
|
[{list: 'ordered'}, {list: 'bullet'}],
|
|
[{header: [1, 2, 3, 4, 5, 6, false]}],
|
|
[{indent: '-1'}, {indent: '+1'}],
|
|
['clean'],
|
|
];
|
|
const qlEditors: NodeListOf<HTMLElement> =
|
|
document.querySelectorAll('.quill-editor');
|
|
qlEditors.forEach(el => {
|
|
const quillElementId = el.id;
|
|
if (!quillElementId) {
|
|
console.error(
|
|
'Please set attribute id to element with class .quill-editor',
|
|
);
|
|
return;
|
|
}
|
|
new Quill('#' + quillElementId, {
|
|
theme: 'snow',
|
|
modules: {
|
|
toolbar: toolbarOptions,
|
|
},
|
|
});
|
|
});
|
|
}
|