[BUGFIX] Trigger inline editing only for page title 58/43158/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Thu, 10 Sep 2015 06:28:15 +0000 (08:28 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Thu, 10 Sep 2015 06:49:29 +0000 (08:49 +0200)
The page title now has a t3js prefixed class to make sure only
this <h1> is editable, and not every <h1> that may occurs, e.g.
in a preview of a content element in the Page module.
Additionally, only the first found element is used.

Resolves: #69600
Releases: master
Change-Id: I17ba4180cb8f71504e5097b8a6b42c4884e46b2b
Reviewed-on: http://review.typo3.org/43158
Reviewed-by: Alexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Alexander Opitz <opitz.alexander@googlemail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Classes/Template/DocumentTemplate.php
typo3/sysext/backend/Resources/Public/JavaScript/PageActions.js

index 73de2bd..45ccae6 100644 (file)
@@ -958,7 +958,7 @@ function jumpToUrl(URL) {
                $str = '
 
        <!-- MAIN Header in page top -->
-       <h1>' . htmlspecialchars($text) . '</h1>
+       <h1 class="t3js-title-inlineedit">' . htmlspecialchars($text) . '</h1>
 ';
                return $this->sectionEnd() . $str;
        }
index 1948571..1ff10fe 100644 (file)
@@ -26,6 +26,7 @@ define('TYPO3/CMS/Backend/PageActions', ['jquery'], function($) {
                        }
                },
                identifier: {
+                       pageTitle: '.t3js-title-inlineedit',
                        hiddenElements: '.t3js-hidden-record'
                },
                elements: {
@@ -62,7 +63,7 @@ define('TYPO3/CMS/Backend/PageActions', ['jquery'], function($) {
        };
 
        PageActions.initializeElements = function() {
-               PageActions.elements.$pageTitle = $('h1');
+               PageActions.elements.$pageTitle = $(PageActions.identifier.pageTitle + ':first');
                PageActions.elements.$showHiddenElementsCheckbox = $('#checkTt_content_showHidden');
        };