diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/PageTree/PageTree.js b/typo3/sysext/backend/Resources/Public/JavaScript/PageTree/PageTree.js
index 170c48c7db9c23e7f7f3ff556f707d7e8d1e800e..bd247ae34ee6b06c4cdb168af6f4da1959e68b79 100644
--- a/typo3/sysext/backend/Resources/Public/JavaScript/PageTree/PageTree.js
+++ b/typo3/sysext/backend/Resources/Public/JavaScript/PageTree/PageTree.js
@@ -412,8 +412,7 @@ define(['jquery',
         .append('input')
         .attr('class', 'node-edit')
         .style('top', function () {
-          var top = _this.data.nodes.indexOf(node) * _this.settings.nodeHeight;
-          top = top + 15; //svg margin top
+          var top = node.y + 15; //svg margin top
           return top + 'px';
         })
         .style('left', (node.x + _this.textPosition + 5) + 'px')
diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/PageTree/PageTreeDragDrop.js b/typo3/sysext/backend/Resources/Public/JavaScript/PageTree/PageTreeDragDrop.js
index 66d8ac1209619526bf185350ac221af8801773aa..d07b8f1511d1770e20badd0def672b7cce0735b3 100644
--- a/typo3/sysext/backend/Resources/Public/JavaScript/PageTree/PageTreeDragDrop.js
+++ b/typo3/sysext/backend/Resources/Public/JavaScript/PageTree/PageTreeDragDrop.js
@@ -752,8 +752,7 @@ define([
         .append('input')
         .attr('class', 'node-edit')
         .style('top', function () {
-          var top = _this.tree.data.nodes.indexOf(newNode) * _this.tree.settings.nodeHeight;
-          top = top + 15; //svg margin top
+          var top = newNode.y + 15; //svg margin top
           return top + 'px';
         })
         .style('left', (newNode.x + _this.tree.textPosition + 5) + 'px')
diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/PageTree/PageTreeElement.js b/typo3/sysext/backend/Resources/Public/JavaScript/PageTree/PageTreeElement.js
index be22f694928c6fea2199fa3c4b0db2941af4e221..a39725abb4b13365981ba6f3f97c8998f7960cf2 100644
--- a/typo3/sysext/backend/Resources/Public/JavaScript/PageTree/PageTreeElement.js
+++ b/typo3/sysext/backend/Resources/Public/JavaScript/PageTree/PageTreeElement.js
@@ -46,25 +46,23 @@ define(['jquery',
      * @param {String} selector
      */
     PageTreeElement.initialize = function (selector) {
-      $(document).ready(function () {
+      $(function () {
         var $element = $(selector);
-        var tree = new PageTree();
 
-        if ($element.html().trim().length === 0) {
-          $element.append(PageTreeElement.template);
+        if ($element.html().trim().length !== 0) {
+          return;
         }
 
-        if ($('.node-loader').html().trim().length === 0) {
-          Icons.getIcon('spinner-circle-light', Icons.sizes.small).done(function (spinner) {
-            $('.node-loader').append(spinner);
-          });
-        }
+        var tree = new PageTree();
+        $element.append(PageTreeElement.template);
 
-        if ($('.svg-tree-loader').html().trim().length === 0) {
-          Icons.getIcon('spinner-circle-light', Icons.sizes.large).done(function (spinner) {
-            $('.svg-tree-loader').append(spinner);
-          });
-        }
+        Icons.getIcon('spinner-circle-light', Icons.sizes.small).done(function (spinner) {
+          $('.node-loader').append(spinner);
+        });
+
+        Icons.getIcon('spinner-circle-light', Icons.sizes.large).done(function (spinner) {
+          $('.svg-tree-loader').append(spinner);
+        });
 
         var dataUrl = top.TYPO3.settings.ajaxUrls.page_tree_data;
         var configurationUrl = top.TYPO3.settings.ajaxUrls.page_tree_configuration;
@@ -74,9 +72,9 @@ define(['jquery',
             dataUrl: dataUrl,
             showIcons: true,
           }));
-        });
 
-        Viewport.NavigationContainer.setComponentInstance(tree);
+          Viewport.NavigationContainer.setComponentInstance(tree);
+        });
 
         if (!$('#svg-toolbar').data('tree-show-toolbar')) {
           var pageTreeToolbar = new PageTreeToolbar();