From 19ac20f3650627b0c311d958072242954c3014c3 Mon Sep 17 00:00:00 2001 From: Madeorsk Date: Sat, 31 Oct 2020 19:42:21 +0100 Subject: [PATCH] Fix classNames when no tagName is specified. --- src/trix/views/piece_view.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/trix/views/piece_view.coffee b/src/trix/views/piece_view.coffee index 27f1e565d..c8965d721 100644 --- a/src/trix/views/piece_view.coffee +++ b/src/trix/views/piece_view.coffee @@ -70,12 +70,13 @@ 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 + + if config.className + element.className = config.className + element createContainerElement: ->