AnsweredAssumed Answered

closing twister by default in documentlibrary section

Question asked by ayubalfresco on Apr 17, 2014
Latest reply on Apr 24, 2014 by ayubalfresco
I am using share 4.2 enterprise. I am trying to accomplish same thing listed in the below forum post:

https://forums.alfresco.com/forum/end-user-discussions/alfresco-share/how-make-sections-displayed-collapsed-mode-12272013-0326

The clue suggested in that post does not work. I also tried to extend document-versions.get.html.ftl using the extensions option, however not able to set the style element to none for the section below the arrow (twister) which displays "Last Version" section.



<@markup id="my-widgets" target= "widgets" action= "replace" scope= "global">
      <#if allowNewVersionUpload??>
         <@createWidgets group="document-details"/>
         <@inlineScript group="document-details">
            YAHOO.util.Event.onContentReady("${args.htmlid?js_string}-heading", function() {
               Alfresco.util.createTwister("${args.htmlid?js_string}-heading", "DocumentVersions");
               YUIDom.addClass("${args.htmlid?js_string}-heading",  "alfresco-twister-closed");
               var doc = document.getElementById("${args.htmlid?js_string}-body");
            var panelBodyDiv = null;
            for (var i = 0; i < doc.childNodes.length; i++) {
                if (doc.childNodes.className == "panel-body") {
                  panelBodyDiv = doc.childNodes;
                  panelBodyDiv.style.display="none";                  
                  break;
                }       
            }
            });
         </@>
      </#if>
   </@>


From the above code YUIDom.addClass("${args.htmlid?js_string}-heading",  "alfresco-twister-closed"); does work and shows the arrow (twister) in closed position. The rest of the code does not hide the text below it.

The behaviour I have seen is that my custom script is inserted before the default inline script present in the out of the box ftl

Outcomes