[BUGFIX] Call only clickOnLabel() in SVG based trees 27/56027/3
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Tue, 6 Mar 2018 20:12:48 +0000 (21:12 +0100)
committerTymoteusz Motylewski <t.motylewski@gmail.com>
Wed, 7 Mar 2018 08:33:14 +0000 (09:33 +0100)
SVG based trees have a method called `clickOnLabel()`, which internally
calls `selectNode()` and also triggers a click event in `nodeBgEvents()`.

However, the latter two calls are repeated after `clickOnLabel()` is
called, causing issues like asking "Do you want to quit without saving?"
twice.

The calls are superfluous and are removed.

Resolves: #84152
Releases: master
Change-Id: Iabcb4ee5bfd0b7094cc52946f4e3be23f4372885
Reviewed-on: https://review.typo3.org/56027
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Riccardo De Contardi <erredeco@gmail.com>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Reviewed-by: Paweł Rogowicz <rogowicz.pawel@gmail.com>
Tested-by: Paweł Rogowicz <rogowicz.pawel@gmail.com>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
typo3/sysext/backend/Resources/Public/JavaScript/PageTree/PageTree.js
typo3/sysext/backend/Resources/Public/JavaScript/SvgTree.js

index 86b9126..81b126f 100644 (file)
@@ -294,8 +294,6 @@ define(['jquery',
               setTimeout(function() {
                 if (clicks === 1) {
                   _this.clickOnLabel(node, this);
-                  _this.nodeBgEvents().click(node, this);
-                  _this.selectNode(node);
                 } else {
                   _this.editNodeLabel(node);
                 }
@@ -305,8 +303,6 @@ define(['jquery',
             }
           } else {
             _this.clickOnLabel(node, this);
-            _this.nodeBgEvents().click(node, this);
-            _this.selectNode(node);
           }
         });
     };
index 3f02e1d..c74feb4 100644 (file)
@@ -769,8 +769,6 @@ define(
           .attr('class', 'node-name')
           .on('click', function(node) {
             _this.clickOnLabel(node, this);
-            _this.nodeBgEvents().click(node, this);
-            _this.selectNode(node);
           });
       },