Skip to content

Commit

Permalink
Fix #1224 - When duplicating a page or a node, all subnodes of the co…
Browse files Browse the repository at this point in the history
…py are undefined
  • Loading branch information
torinfo committed Jun 7, 2023
1 parent dfccd71 commit 5b52743
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions editor/js/tree.js
Expand Up @@ -542,6 +542,11 @@ var EDITOR = (function ($, parent) {
// Be careful. You cannot just find $("#" + current_node.id + "_text").html(), because if the node is collapsed this will return undefined!
// var nodeText = $("#" + current_node.id + "_text").html();
var nodeText = $("<div>").html(current_node.text).find("#" + current_node.id + "_text").html();
// Nodes that are created in this session are different, and only contain the text. The above line will return undefined for these nodes.
if (nodeText == undefined)
{
nodeText = current_node.text;
}

var treeLabel = '<span id="' + key + '_container">' + unmarkIcon + hiddenIcon + passwordIcon + standaloneIcon + deprecatedIcon + advancedIcon + '</span><span id="' + key + '_text">' + nodeText + '</span>';
// Create the tree node
Expand Down

0 comments on commit 5b52743

Please sign in to comment.