optimization: in paragraph menu

This commit is contained in:
Jocs 2018-05-16 17:49:26 +08:00
parent c90bf90e66
commit 968891d334

View File

@ -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