Skip to content

Commit

Permalink
Specify className in textAttributes.
Browse files Browse the repository at this point in the history
This allow to pass className in textAttributes to set custom classes.
  • Loading branch information
Madeorsk committed Oct 31, 2020
1 parent 7efb14b commit b6ec8f5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/trix/views/piece_view.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ class Trix.PieceView extends Trix.ObjectView
if config.style
styles[key] = value for key, value of config.style

if config.className
pendingElement.className = config.className

if Object.keys(styles).length
element ?= makeElement("span")
element.style[key] = value for key, value of styles
Expand Down

0 comments on commit b6ec8f5

Please sign in to comment.