[BUGFIX] Hide foreign_selector if maxitems is reached 36/19336/5
authorStefan Frömken <sfroemken@jweiland.net>
Wed, 27 Mar 2013 07:15:24 +0000 (08:15 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sun, 18 Jan 2015 20:14:57 +0000 (21:14 +0100)
If the number of elements is reached (maxitems) then
foreign_selector is still there. If maxitems is reached
it does not make sense keep showing this selector.

Resolves: #46552
Releases: master
Change-Id: Ic780c2dfae0fcaaf1938c142ae8731a9109ff1b0
Reviewed-on: http://review.typo3.org/19336
Reviewed-by: Stefan Froemken <froemken@gmail.com>
Tested-by: Stefan Froemken <froemken@gmail.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/backend/Classes/Form/Element/InlineElement.php
typo3/sysext/backend/Resources/Public/JavaScript/jsfunc.inline.js

index c54a53d..65a2fed 100644 (file)
@@ -859,7 +859,9 @@ class InlineElement {
                                $createNewRelationText = $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:cm.createNewRelation', TRUE);
                        }
                        $item .= ' <a href="#" class="btn btn-default" onclick="' . htmlspecialchars($onChange) . '" align="abstop">' . IconUtility::getSpriteIcon('actions-document-new', array('title' => $createNewRelationText)) . $createNewRelationText . '</a>';
-                       $item = '<div class="t3-form-field-group">' . $item . '</div>';
+                       // Wrap the selector and add a spacer to the bottom
+                       $nameObject = $this->inlineNames['object'];
+                       $item = '<div class="t3-form-field-group ' . $this->inlineData['config'][$nameObject]['md5'] . '">' . $item . '</div>';
                }
                return $item;
        }
index cea361b..4cce270 100644 (file)
@@ -781,6 +781,7 @@ var inline = {
                        var objectParent = this.parseObjectId('full', objectPrefix, 0, 1);
                        var md5 = this.getObjectMD5(objectParent);
                        this.hideElementsWithClassName('.inlineNewButton' + (md5 ? '.' + md5 : ''), objectParent);
+                       this.hideElementsWithClassName('.inlineForeignSelector' + (md5 ? '.' + md5 : ''), 't3-form-field-item');
                }
 
                if (TBE_EDITOR) {
@@ -980,6 +981,7 @@ var inline = {
                        var objectParent = this.parseObjectId('full', objectPrefix, 0, 1);
                        var md5 = this.getObjectMD5(objectParent);
                        this.showElementsWithClassName('.inlineNewButton' + (md5 ? '.' + md5 : ''), objectParent);
+                       this.showElementsWithClassName('.inlineForeignSelector' + (md5 ? '.'+md5 : ''), 't3-form-field-item');
                }
                return false;
        },