If you use CollapseFieldsPatronAddForm to collapse Patron restrictions, it will cause hidden elements within to be out of sync. I've used the following to compensate for this flaw: //Fix expanded restriction form with nested collapsed section $('#pat_memberentrygen #memberentry_restrictions').wrapInner('<div id="restrictionContainer" style="display:none;"></div>'); $('#pat_memberentrygen #restrictionContainer').children().show(); $('#pat_memberentrygen #manual_restriction_form').children().show(); $('#pat_memberentrygen #memberentry_restrictions').prepend($('#restrictions_lgd')); $('#pat_memberentrygen #manual_restriction_form').hide();
Can you explain what is meant by "out of sync" and maybe add a step by step on how to see the issue fixed by the jQuery?
1. Set Patron restrictions as one of the collapsed fields in CollapseFieldsPatronAddForm. 2. Edit a patron. 3. Patron restrictions is collapsed. Click on it to open it. 4. See that the empty Add manual restriction legend shows below the link to Add manual restriction. This area should not show until the link is clicked. 5. Click the link. The link disappears. 6. Click the legend. The content appears. 7. Click cancel. The legend and content disappear as expected. 8. Click the Patron restriction legend. That section collapses, but the Add manual restriction legend and contents show. The Add manual restriction legend should not be showing, and should not be acting like the other legends. It should be hidden until the link is clicked, and it should be hidden when cancel is clicked. It should not be acting like the parent, and as is, and depending on the state it is in (showing or hidden), is out of sync with the parent.