Commit a9326c52 authored by Tymoteusz Motylewski's avatar Tymoteusz Motylewski
Browse files

[BUGFIX] Register page tree navigation component after it is initialized

Now Viewport.NavigationContainer.setComponentInstance(tree);
is called after the tree is initialized.
A check to prevent multiple initialization calls is added.

Also position of the title edit imput is corrected
in case where there are multiple mount points.

Releases: master
Resolves: #83299
Change-Id: I5b9cc14b362ab20ecb7631babe3f3f83eb8bfb48
Reviewed-on: https://review.typo3.org/55043


Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Frans Saris's avatarFrans Saris <franssaris@gmail.com>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Frans Saris's avatarFrans Saris <franssaris@gmail.com>
Reviewed-by: Tymoteusz Motylewski's avatarTymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Tymoteusz Motylewski's avatarTymoteusz Motylewski <t.motylewski@gmail.com>
parent 5bb7e76e
......@@ -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')
......
......@@ -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')
......
......@@ -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();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment