diff --git a/HISTORY.md b/HISTORY.md index 36bb801..73ba530 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -9,6 +9,8 @@ https://github.com/josdejong/jsoneditor can overflow the borders of the editor. - Fixed #568: mode switcher disappearing when selecting the current mode again. +- Fixed `transform` not creating/removing expand button when the type + of a node changed. ## 2018-08-22, version 5.24.0 diff --git a/src/js/Node.js b/src/js/Node.js index c02bd99..c629d05 100644 --- a/src/js/Node.js +++ b/src/js/Node.js @@ -616,17 +616,16 @@ Node.prototype.setInternalValue = function(internalValue) { * Remove the DOM of this node and it's childs and recreate it again */ Node.prototype.recreateDom = function() { - // only recreate dom if there is a dom already - if (!this.dom || ! this.dom.tr || !this.dom.tr.parentNode) { - return; + if (this.dom && this.dom.tr && this.dom.tr.parentNode) { + var domAnchor = this._detachFromDom(); + + this.clearDom(); + + this._attachToDom(domAnchor); + } + else { + this.clearDom(); } - - var domAnchor = this._detachFromDom(); - - // delete the DOM - this.clearDom(); - - this._attachToDom(domAnchor); }; /**