fixing database connections

This commit is contained in:
2024-09-07 13:22:58 +03:00
parent cf3d621587
commit 0cd4e08716
16 changed files with 119 additions and 79 deletions
+16 -1
View File
@@ -28,6 +28,15 @@
editor.addEventListener("trix-file-accept", (e) => {
e.preventDefault();
})
editor.addEventListener("trix-before-initialize", (e) => {
Trix.config.blockAttributes.heading1.tagName = 'h2';
const { toolbarElement } = e.target
const h1Button = toolbarElement.querySelector("[data-trix-attribute=heading1]")
h1Button.insertAdjacentHTML("afterend", `<button style="text-indent: initial;padding: 14px 10px !important;" type="button" class="trix-button trix-button--icon" data-trix-attribute="heading3" title="Heading 3" tabindex="-1" data-trix-active="">H3</button>`)
})
})
// onDestroy(() => {
// editor.removeEventListener("trix-before-initialize")
@@ -35,7 +44,13 @@
Trix.config.blockAttributes.default.breakOnReturn = false
console.log(Trix.config)
Trix.config.blockAttributes.heading3 = {
tagName: 'h3',
terminal: true,
breakOnReturn: true,
group: false
}
// console.log(Trix.config)
</script>