Fixed changing type of object to array and vice versa
This commit is contained in:
parent
6a15c04053
commit
402afe92e2
|
@ -579,21 +579,23 @@ Node.prototype._getNextTr = function() {
|
|||
|
||||
/**
|
||||
* Hide the node with all its childs
|
||||
* @param {{resetMaxVisibleChilds: boolean}} [options]
|
||||
*/
|
||||
Node.prototype.hide = function() {
|
||||
Node.prototype.hide = function(options) {
|
||||
var tr = this.dom.tr;
|
||||
var table = tr ? tr.parentNode : undefined;
|
||||
if (table) {
|
||||
table.removeChild(tr);
|
||||
}
|
||||
this.hideChilds();
|
||||
this.hideChilds(options);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Recursively hide all childs
|
||||
* @param {{resetMaxVisibleChilds: boolean}} [options]
|
||||
*/
|
||||
Node.prototype.hideChilds = function() {
|
||||
Node.prototype.hideChilds = function(options) {
|
||||
var childs = this.childs;
|
||||
if (!childs) {
|
||||
return;
|
||||
|
@ -620,7 +622,9 @@ Node.prototype.hideChilds = function() {
|
|||
}
|
||||
|
||||
// reset max visible childs
|
||||
if (!options || options.resetMaxVisibleChilds) {
|
||||
delete this.maxVisibleChilds;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
@ -1136,7 +1140,7 @@ Node.prototype.changeType = function (newType) {
|
|||
var nextTr = (lastTr && lastTr.parentNode) ? lastTr.nextSibling : undefined;
|
||||
|
||||
// hide current field and all its childs
|
||||
this.hide();
|
||||
this.hide({ resetMaxVisibleChilds: false });
|
||||
this.clearDom();
|
||||
|
||||
// adjust the field and the value
|
||||
|
|
|
@ -101,8 +101,10 @@ function showMoreNodeFactory(Node) {
|
|||
|
||||
if (!this.dom.tr.parentNode) {
|
||||
var nextTr = this.parent._getNextTr();
|
||||
if (nextTr) {
|
||||
nextTr.parentNode.insertBefore(this.dom.tr, nextTr);
|
||||
}
|
||||
}
|
||||
|
||||
// update the counts in the text
|
||||
this.dom.moreText.nodeValue = this._getShowMoreText();
|
||||
|
|
Loading…
Reference in New Issue