mirror of
https://github.com/marktext/marktext.git
synced 2025-05-22 03:40:27 +08:00
optimization: in paragraph menu
This commit is contained in:
parent
c90bf90e66
commit
968891d334
@ -83,9 +83,6 @@ const paragraphCtrl = ContentState => {
|
|||||||
start: { key, offset },
|
start: { key, offset },
|
||||||
end: { key, offset }
|
end: { key, offset }
|
||||||
}
|
}
|
||||||
this.render()
|
|
||||||
const selectionChanges = this.selectionChange()
|
|
||||||
this.eventCenter.dispatch('selectionChange', selectionChanges)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ContentState.prototype.handleListMenu = function (paraType) {
|
ContentState.prototype.handleListMenu = function (paraType) {
|
||||||
@ -325,7 +322,8 @@ const paragraphCtrl = ContentState => {
|
|||||||
|
|
||||||
switch (paraType) {
|
switch (paraType) {
|
||||||
case 'front-matter': {
|
case 'front-matter': {
|
||||||
return this.handleFrontMatter()
|
this.handleFrontMatter()
|
||||||
|
break
|
||||||
}
|
}
|
||||||
case 'ul-bullet':
|
case 'ul-bullet':
|
||||||
case 'ul-task':
|
case 'ul-task':
|
||||||
@ -444,8 +442,15 @@ const paragraphCtrl = ContentState => {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (paraType === 'front-matter') {
|
||||||
|
this.render()
|
||||||
|
} else {
|
||||||
this.partialRender()
|
this.partialRender()
|
||||||
}
|
}
|
||||||
|
// update menu status
|
||||||
|
const selectionChanges = this.selectionChange()
|
||||||
|
this.eventCenter.dispatch('selectionChange', selectionChanges)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default paragraphCtrl
|
export default paragraphCtrl
|
||||||
|
Loading…
Reference in New Issue
Block a user