Search code examples
macrosexpandconfluence

Expand-all for Confluence UI-Expand macro


I've poked around Google and the Atlassian forums about this, and have not found an answer to this anywhere.

I'm trying to come up with an "Expand All" button for the UI Expand (important: not the regular Expand) macro.

I found this link in the Atlassian forum. I've been messing around with it, but I haven't been able to get it to work in my Confluence pages. I suspect that part of the problem is the UI Expand naming convention -- the link, which assumes the regular Expand macro, uses ".expand-control", but I'm wondering if it needs to be something like ui-expand, ui-expand-control, RWUI, etc. I've tried different combinations, and haven't gotten it to work.

Has anyone else come across this? Has anyone figured this out?

Thanks in advance...


Solution

  • I figured it out! The correct class name is rwui_expand.

    I took the code from the Atlassian forum and changed it from this:

    jQuery(".expand-control").each(function(){ jQuery(this).trigger("click");})
    

    to this...

    jQuery(".rwui_expand").each(function(){ jQuery(this).trigger("click");})
    

    Works like a champ!