diff --git a/docs/change-log.md b/docs/change-log.md index 1627c459..d889581a 100644 --- a/docs/change-log.md +++ b/docs/change-log.md @@ -18,6 +18,7 @@ - fix dom element ownership bug when mixing keyed elements and third party plugin elements [#463](https://github.com/lhorie/mithril.js/issues/463) - fix edge case in flatten algorithm [#448](https://github.com/lhorie/mithril.js/issues/448) - prevent unnecessary DOM move operation when mixing keyed and unkeyed elements [#398](https://github.com/lhorie/mithril.js/issues/398) +- revert [#382](https://github.com/lhorie/mithril.js/issues/382) due to diff regression [#512](https://github.com/lhorie/mithril.js/issues/512) --- diff --git a/mithril.js b/mithril.js index b9d2a974..8cd2181b 100644 --- a/mithril.js +++ b/mithril.js @@ -61,7 +61,8 @@ var m = (function app(window, undefined) { for (var attrName in attrs) { if (attrName === classAttrName) { - if (attrs[attrName] !== "") cell.attrs[attrName] = (cell.attrs[attrName] || "") + " " + attrs[attrName]; + var className = cell.attrs[attrName] + cell.attrs[attrName] = (className && attrs[attrName] ? className + " " : className || "") + attrs[attrName]; } else cell.attrs[attrName] = attrs[attrName] }