Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/text.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/nodes
diff options
context:
space:
mode:
authorVinicius Reis <vinicius.reis@nextcloud.com>2022-08-16 22:11:43 +0300
committerVinicius Reis <vinicius.reis@nextcloud.com>2022-08-17 17:42:59 +0300
commit713720d14db3a0ad0405bdf4b047018a7d6cf6c8 (patch)
tree0d99813724d02214904b9cef9fdd156314c69508 /src/nodes
parent381797c4c6730c918e0c0fa57e3e838059d828d2 (diff)
🐛 (#107): calcule headers on creation
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
Diffstat (limited to 'src/nodes')
-rw-r--r--src/nodes/Heading/index.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nodes/Heading/index.js b/src/nodes/Heading/index.js
index 258b094fb..ce7e73e78 100644
--- a/src/nodes/Heading/index.js
+++ b/src/nodes/Heading/index.js
@@ -31,6 +31,14 @@ const Heading = TipTapHeading.extend({
}
},
+ onCreate() {
+ extractHeadings(this.editor)
+
+ if (this.parent) {
+ this.parent()
+ }
+ },
+
onUpdate: debounce(function onUpdate({ editor }) {
extractHeadings(editor)
}, 900),