MCPcopy Create free account
hub / github.com/docusealco/docuseal / toggleLink

Method toggleLink

app/javascript/elements/html_editor.js:615–626  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

613 }
614
615 toggleLink () {
616 if (this.editor.isActive('link')) {
617 this.linkTooltip.hide()
618 this.editor.chain().focus().extendMarkRange('link').unsetLink().run()
619 this.updateToolbarState()
620 } else {
621 const { from } = this.editor.state.selection
622
623 this.linkTooltip.hide()
624 this.linkTooltip.show(this.editor.getAttributes('link').htmlAttrs?.href, from, { focus: true })
625 }
626 }
627
628 insertVariable (e) {
629 const variable = e.target.closest('[data-variable]')?.dataset.variable

Callers 2

connectedCallbackMethod · 0.45
linkSelectionMethod · 0.45

Calls 3

hideMethod · 0.80
updateToolbarStateMethod · 0.45
showMethod · 0.45

Tested by

no test coverage detected