Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/content/1_docs/4_form-fields/02_wysiwyg.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ $wysiwygOptions = [
'bold',
'italic',
'underline',
'subscript',
'superscript',
'strike',
'blockquote',
'code-block',
Expand Down
5 changes: 5 additions & 0 deletions frontend/icons-wysiwyg/wysiwyg_subscript.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions frontend/icons-wysiwyg/wysiwyg_superscript.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions frontend/js/components/WysiwygTiptap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@
v-if="toolbar.underline"
:isActive="editor.isActive('underline')"
@btn:click="editor.chain().focus().toggleUnderline().run()"/>
<wysiwyg-menu-bar-btn icon="subscript"
v-if="toolbar.subscript"
:isActive="editor.isActive('subscript')"
@btn:click="editor.chain().focus().toggleSubscript().run()"/>
<wysiwyg-menu-bar-btn icon="superscript"
v-if="toolbar.superscript"
:isActive="editor.isActive('superscript')"
@btn:click="editor.chain().focus().toggleSuperscript().run()"/>

<wysiwyg-menu-bar-btn icon="hr"
v-if="toolbar.hr"
Expand Down Expand Up @@ -253,6 +261,8 @@
import TableRow from '@tiptap/extension-table-row'
import TableCell from '@tiptap/extension-table-cell'
import TableHeader from '@tiptap/extension-table-header'
import Subscript from '@tiptap/extension-subscript'
import Superscript from '@tiptap/extension-superscript'
import {mapState} from 'vuex'

import StandaloneBrowser from "@/components/StandaloneBrowser.vue";
Expand Down Expand Up @@ -371,6 +381,8 @@
bold: true,
italic: true,
underline: true,
subscript: true,
superscript: true,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will enable them by default on all Tiptap fields where the developer passes an empty array of options, which I don't think should be the case in a minor release.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, this was probably too much

link: true
},
headingOptions: [],
Expand Down Expand Up @@ -611,6 +623,14 @@
extensions.push(Underline)
break;
}
case 'subscript': {
extensions.push(Subscript)
break;
}
case 'superscript': {
extensions.push(Superscript)
break;
}
case 'table': {
extensions.push(Table.configure({
resizable: false
Expand Down
Loading