[BUGFIX] IRRE: close open records correctly when expandSingle is set 52/40552/5
authorAndreas Allacher <andreas.allacher@gmx.at>
Tue, 23 Jun 2015 10:46:44 +0000 (12:46 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Fri, 26 Jun 2015 00:32:34 +0000 (02:32 +0200)
inline records are now closed correctly when using expandSingle.
Prior to this commit if a record was opened,
all open records remained open instead of being closed

Resolves: #67691
Releases: master
Change-Id: I5e815824181be17622558c55c452d4a1dac5c339
Reviewed-on: http://review.typo3.org/40552
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/backend/Classes/Form/Container/InlineRecordContainer.php
typo3/sysext/backend/Resources/Public/JavaScript/jsfunc.inline.js

index d456aea..ddd3d4a 100644 (file)
@@ -182,7 +182,7 @@ class InlineRecordContainer extends AbstractContainer {
                        $class .= ($isNewRecord ? ' inlineIsNewRecord' : '');
                        $html = '
                                <div class="panel panel-default panel-condensed ' . trim($class) . '" id="' . $objectId . '_div">
-                                       <div class="panel-heading" data-toggle="formengine-inline" id="' . $objectId . '_header">
+                                       <div class="panel-heading" data-toggle="formengine-inline" id="' . $objectId . '_header" data-expandSingle="' . ($config['appearance']['expandSingle'] ? 1 : 0) . '">
                                                <div class="form-irre-header">
                                                        <div class="form-irre-header-cell form-irre-header-icon">
                                                                <span class="caret"></span>
index 138ae9b..18aab48 100644 (file)
@@ -126,9 +126,9 @@ var inline = {
                                recObjectId = objectPrefix + this.structureSeparator + records[i];
                                escapedRecordObjectId = this.escapeObjectId(recObjectId);
 
-                               var $recordEntry = TYPO3.jQuery('#' + escapedRecordObjectId);
+                               var $recordEntry = TYPO3.jQuery('#' + escapedRecordObjectId + '_div');
                                if (records[i] != callingUid && $recordEntry.hasClass(this.classVisible)) {
-                                       TYPO3.jQuery('#' + escapedRecordObjectId + '_div').removeClass(this.classVisible).addClass(this.classCollapsed);
+                                       $recordEntry.removeClass(this.classVisible).addClass(this.classCollapsed);
                                        if (this.isNewRecord(recObjectId)) {
                                                this.updateExpandedCollapsedStateLocally(recObjectId, 0);
                                        } else {