Commit 50a9fb0a authored by Nikita Hovratov's avatar Nikita Hovratov Committed by Benni Mack
Browse files

[BUGFIX] Prevent toggling of child containers controls

The toggleContainerControls method of InlineControlContainer.ts now
only toggles its immediate controls. Furthermore, the new record link
control for creating inline records has gotten the required class to
toggle its visibility, when reaching maxitems limit.

Resolves: #91808
Releases: master, 10.4
Change-Id: Ic8988943c349c874b6d9b7427a42c224dca1ded1
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/65058


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent 722ed796
......@@ -39,7 +39,7 @@ enum Selectors {
synchronizeLocalizeRecordButtonSelector = '.t3js-synchronizelocalize-button',
uniqueValueSelectors = 'select.t3js-inline-unique',
revertUniqueness = '.t3js-revert-unique',
controlContainerButtons = '.t3js-inline-controls',
controlContainer = '.t3js-inline-controls',
}
enum States {
......@@ -764,7 +764,8 @@ class InlineControlContainer {
* @param {boolean} visible
*/
private toggleContainerControls(visible: boolean): void {
const controlContainerButtons = this.container.querySelectorAll(Selectors.controlContainerButtons + ' a');
const controlContainer = this.container.querySelector(Selectors.controlContainer);
const controlContainerButtons = controlContainer.querySelectorAll('a');
controlContainerButtons.forEach((button: HTMLElement): void => {
button.style.display = visible ? null : 'none';
});
......
......@@ -409,7 +409,7 @@ class InlineControlContainer extends AbstractContainer
case 'newRecord':
$title = htmlspecialchars($languageService->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.createnew'));
$icon = 'actions-add';
$className = 'typo3-newRecordLink';
$className = 'typo3-newRecordLink t3js-inline-controls';
$attributes['class'] = 'btn btn-default t3js-create-new-button';
if (!empty($conf['inline']['inlineNewButtonStyle'])) {
$attributes['style'] = $conf['inline']['inlineNewButtonStyle'];
......
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