rename bulletlist command

This commit is contained in:
Philipp Kühn 2020-11-18 11:33:33 +01:00
parent 56bb26f124
commit 6ca1a6c307
8 changed files with 10 additions and 10 deletions

View File

@ -40,7 +40,7 @@
<button @click="editor.chain().focus().heading({ level: 6 }).run()" :class="{ 'is-active': editor.isActive('heading', { level: 6 }) }">
h6
</button>
<button @click="editor.chain().focus().bulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
<button @click="editor.chain().focus().toggleBulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
bullet list
</button>
<button @click="editor.chain().focus().orderedList().run()" :class="{ 'is-active': editor.isActive('orderedList') }">

View File

@ -40,7 +40,7 @@
<button @click="editor.chain().focus().heading({ level: 6 }).run()" :class="{ 'is-active': editor.isActive('heading', { level: 6 }) }">
h6
</button>
<button @click="editor.chain().focus().bulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
<button @click="editor.chain().focus().toggleBulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
bullet list
</button>
<button @click="editor.chain().focus().orderedList().run()" :class="{ 'is-active': editor.isActive('orderedList') }">

View File

@ -40,7 +40,7 @@
<button @click="editor.chain().focus().heading({ level: 6 }).run()" :class="{ 'is-active': editor.isActive('heading', { level: 6 }) }">
h6
</button>
<button @click="editor.chain().focus().bulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
<button @click="editor.chain().focus().toggleBulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
bullet list
</button>
<button @click="editor.chain().focus().orderedList().run()" :class="{ 'is-active': editor.isActive('orderedList') }">

View File

@ -1,6 +1,6 @@
<template>
<div v-if="editor">
<button @click="editor.chain().focus().bulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
<button @click="editor.chain().focus().toggleBulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
bullet list
</button>

View File

@ -1,6 +1,6 @@
<template>
<div v-if="editor">
<button @click="editor.chain().focus().bulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
<button @click="editor.chain().focus().toggleBulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
bullet list
</button>
<button @click="editor.chain().focus().orderedList().run()" :class="{ 'is-active': editor.isActive('orderedList') }">

View File

@ -104,7 +104,7 @@ const CustomBulletList = BulletList.extend({
addKeyboardShortcuts() {
return {
// ↓ your new keyboard shortcut
'Mod-l': () => this.editor.commands.bulletList(),
'Mod-l': () => this.editor.commands.toggleBulletList(),
}
},
})

View File

@ -25,7 +25,7 @@ import BulletList from '@tiptap/extension-bullet-list'
const CustomBulletList = BulletList.extend({
addKeyboardShortcuts() {
return {
'Mod-l': () => this.editor.commands.bulletList(),
'Mod-l': () => this.editor.commands.toggleBulletList(),
}
},
})
@ -296,7 +296,7 @@ import BulletList from '@tiptap/extension-bullet-list'
const CustomBulletList = BulletList.extend({
addKeyboardShortcuts() {
return {
'Mod-l': () => this.editor.commands.bulletList(),
'Mod-l': () => this.editor.commands.toggleBulletList(),
}
},
})

View File

@ -35,7 +35,7 @@ const BulletList = Node.create({
/**
* Toggle a bullet list
*/
bulletList: (): Command => ({ commands }) => {
toggleBulletList: (): Command => ({ commands }) => {
return commands.toggleList('bulletList', 'listItem')
},
}
@ -43,7 +43,7 @@ const BulletList = Node.create({
addKeyboardShortcuts() {
return {
'Shift-Control-8': () => this.editor.commands.bulletList(),
'Shift-Control-8': () => this.editor.commands.toggleBulletList(),
}
},