fix: 标题按钮设置异常,错别字修复

This commit is contained in:
rsl140 2021-01-09 17:22:42 +08:00
parent ee43811f22
commit 37addbc081
5 changed files with 14 additions and 5 deletions

View File

@ -11,7 +11,7 @@ describe('test editor.txt.append()', () => {
cy.get('#div1').contains('欢迎使用 wangEditor 富文本编辑器')
cy.getEditor().then((editor: Editor) => {
const menusLen = editor.menus.menuList.length
const menusLen = editor.menus.menuList.length + 1
cy.getByClass('toolbar')
.children()
.should('have.length', menusLen + 1)

View File

@ -11,7 +11,7 @@ describe('test editor.txt.html()功能', () => {
cy.get('#div1').contains('123456')
cy.getEditor().then((editor: Editor) => {
const menusLen = editor.menus.menuList.length
const menusLen = editor.menus.menuList.length + 1
cy.getByClass('toolbar')
.children()
.should('have.length', menusLen + 1)

View File

@ -36,7 +36,7 @@ export default {
: '恢复',
: '撤销',
: '全屏',
: '代办事项',
: '待办事项',
},
dropListMenu: {
: '设置标题',
@ -164,7 +164,7 @@ export default {
: 'undo',
: 'redo',
: 'fullscreen',
: 'todo',
: 'todo',
},
dropListMenu: {
: 'title',

View File

@ -60,6 +60,15 @@ class Head extends DropListMenu implements MenuActive {
return
}
// 选中内容包含序列code表格分割线时不处理
if (
['OL', 'UL', 'LI', 'TABLE', 'TH', 'TR', 'CODE', 'HR'].indexOf(
$($selectionElem).getNodeName()
) > -1
) {
return
}
editor.cmd.do('formatBlock', value)
// 标题设置成功且不是<p>正文标签就配置大纲id

View File

@ -9,7 +9,7 @@ import createTodo from './todo'
class Todo extends BtnMenu implements MenuActive {
constructor(editor: Editor) {
const $elem = $(
`<div class="w-e-menu" data-title="办事项">
`<div class="w-e-menu" data-title="办事项">
<i class="w-e-icon-checkbox-checked"></i>
</div>`
)