Hello Andy,
The one's which you want collapsed mode by default, simply add and pass an optional parameter to 'createTwister' method.
For example, lets say I want to implement this on 'Document Properties' component.
Open 'document-metadata.get.html.ftl', locate the below line of code
Alfresco.util.createTwister("${el}-heading", "DocumentMetadata");
and add 'collapsed' parameter as done below
Alfresco.util.createTwister("${el}-heading", "DocumentMetadata", {"collapsed": true});
Now open 'alfresco.js', and locate the 'Alfresco.util.createTwister' method
and add the below mentioned lines of code
if(config.collapsed)
{
isCollapsed = true;
}
to the below exact mentioned place.
var collapsedPrefs = Alfresco.util.arrayToObject(Alfresco.util.createTwister.collapsed.split(",")),
isCollapsed = !!collapsedPrefs[p_filterName];
// Initial State
YUIDom.addClass(elController, config.CLASS_BASE);
***********Start Added code***************
if(config.collapsed)
{
isCollapsed = true;
}
***********End Added code***************
YUIDom.addClass(elController, isCollapsed ? config.CLASS_CLOSED : config.CLASS_OPEN);
YUIDom.setStyle(elPanel, "display", isCollapsed ? "none" : "block");
Refresh Web Scripts and verify it.
Please let me know if it was helpful or in case of any issues implementing this.
Note: Don't forget to convert 'alfresco.js' to minified 'alfresco-min.js'