add type option to updateNodeAttributes

This commit is contained in:
Philipp Kühn
2020-11-18 14:46:47 +01:00
parent b3798b7329
commit 4a78318a74
2 changed files with 7 additions and 4 deletions

View File

@@ -42,13 +42,13 @@ const TextAlign = Extension.create({
return false
}
return commands.updateNodeAttributes({ textAlign: alignment })
return this.options.types.every(type => commands.updateNodeAttributes(type, { textAlign: alignment }))
},
/**
* Unset the text align attribute
*/
unsetTextAlign: (): Command => ({ commands }) => {
return commands.updateNodeAttributes({ textAlign: null })
return this.options.types.every(type => commands.updateNodeAttributes(type, { textAlign: null }))
},
}
},