[FEATURE] Select first element of PageTree toolbar on initialization 15/57815/6
authorPaweł Rogowicz <rogowicz.pawel@gmail.com>
Sun, 5 Aug 2018 09:47:20 +0000 (11:47 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Fri, 10 Aug 2018 16:33:14 +0000 (18:33 +0200)
The first element of the PageTree toolbar is selected when initialized.
The possibility to close/hide a toolbar option has been removed. Either
the page type or the filter/search is displayed.

Releases: master
Resolves: #13265
Change-Id: I055c877d300ba023ae880679a9a602f95a40c374
Reviewed-on: https://review.typo3.org/57815
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Tested-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Reviewed-by: Tim Schreiner <schreiner.tim@gmail.com>
Tested-by: Tim Schreiner <schreiner.tim@gmail.com>
Reviewed-by: Björn Jacob <bjoern.jacob@tritum.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/backend/Resources/Public/JavaScript/PageTree/PageTreeToolbar.js
typo3/sysext/core/Documentation/Changelog/master/Feature-13265-MakeFirstOptionToolbarOpenByDefaultInThePageTree.rst [new file with mode: 0644]

index 2f4d7b7..0439742 100644 (file)
@@ -156,17 +156,16 @@ define(['jquery',
 
       //toggle toolbar submenu
       $toolbar.find('[data-tree-show-submenu]').each(function() {
-        var _this = this;
         $(this).click(function() {
           var $this = $(this);
           var name = $this.attr('data-tree-show-submenu');
           var $submenu = $toolbar.find('[data-tree-submenu=' + name + ']');
 
           $toolbar.find('[data-tree-show-submenu]').not(this).removeClass('active');
-          $this.toggleClass('active');
+          $this.addClass('active');
 
           $toolbar.find('[data-tree-submenu]').not($submenu).removeClass('active');
-          $submenu.toggleClass('active', $this.hasClass('active'));
+          $submenu.addClass('active');
           $submenu.find('input').focus();
         });
       });
@@ -190,6 +189,12 @@ define(['jquery',
       });
 
       $toolbar.find('[data-toggle="tooltip"]').tooltip();
+
+      if ($('[data-tree-show-submenu="page-new"]').length) {
+        $('[data-tree-show-submenu="page-new"]').trigger('click');
+      } else {
+        $('.svg-toolbar__menu :first-child:not(.js-svg-refresh)').trigger('click');
+      }
     };
 
     /**
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-13265-MakeFirstOptionToolbarOpenByDefaultInThePageTree.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-13265-MakeFirstOptionToolbarOpenByDefaultInThePageTree.rst
new file mode 100644 (file)
index 0000000..9083d57
--- /dev/null
@@ -0,0 +1,21 @@
+.. include:: ../../Includes.txt
+
+============================================================================
+Feature: #13265 - Select first element of PageTree toolbar on initialization
+============================================================================
+
+See :issue:`13265`
+
+Description
+===========
+
+The first element of the PageTree toolbar is now selected when initialized. The possibility to
+close/hide a toolbar option has been removed. Either the page type or the filter/search is displayed.
+
+
+Impact
+======
+
+The user always sees an open element of the PageTree toolbar.
+
+.. index:: Backend, JavaScript, ext:backend
\ No newline at end of file