fix: 标题按钮设置异常,错别字修复
This commit is contained in:
parent
ee43811f22
commit
37addbc081
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -36,7 +36,7 @@ export default {
|
|||
恢复: '恢复',
|
||||
撤销: '撤销',
|
||||
全屏: '全屏',
|
||||
代办事项: '代办事项',
|
||||
待办事项: '待办事项',
|
||||
},
|
||||
dropListMenu: {
|
||||
设置标题: '设置标题',
|
||||
|
@ -164,7 +164,7 @@ export default {
|
|||
恢复: 'undo',
|
||||
撤销: 'redo',
|
||||
全屏: 'fullscreen',
|
||||
代办事项: 'todo',
|
||||
待办事项: 'todo',
|
||||
},
|
||||
dropListMenu: {
|
||||
设置标题: 'title',
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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>`
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue