Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Expand macro colapses after expanding code block inside

Natalia Perminova August 19, 2020

Hello, community!

I have an issue with Expand macro and Code block inside:

I have

{expand}
     content inside
     {code|collapse=true}
     {code}
{expand}

 

When I try to view content under Expand macro:

1. Expand the section
2. Click Expand Code block
3. Expand macro automatically collapses in a half a second
4. Expand the section again
5. Code block is expanded
6. Collapse Code block
7. Expand macro automatically collapses in a half a second again

Is it a bug? Have anybody met that issue? Is there any solution for that?

Our wiki is on Server 6.15

 

Thanks

1 answer

1 accepted

0 votes
Answer accepted
Bill Bailey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 19, 2020

Why the nesting of expand functions? Can't you just have a standard code block inside the expand macro?

My suspicion is that  you are seeing a conflict between expand events, that toggling one, causes the other to toggle. It would take some work to debug, so it might be easier to just restructure the content. For example, if you need to have the code separately expandable, then have then all at the same level:

  • Expand macro
  • Code macro
  • Expand macro
Natalia Perminova August 20, 2020

Well, actually the content is not such simple. There are several expandable sections, each of them have several steps to take with code blocks as examples. And they are just a small part of the whole page content. If the code macro is not collapsed initially, the guide looks too long and takes extra efforts to scroll it all down. And the content inside expand macro is actual for different users, they don't need to see the whole content of whole sections.

Probably I need to think of another way to structure my content (tabs maybe). The one with expand and code block macros was the easiest.

Could you tell me what should be done to debug it? Still hope to use it in future. Or maybe as our wiki is on Server, I better contact with our support group?

Bill Bailey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 20, 2020

I assume it is controlled via JavaScript. So maybe if you have the browser console open, you can figure out which script is operating.

The other option is to create your own code macro, basically a user macro that includes your JavaScript and wraps a standard code macro so that the two operations are separate.

Natalia Perminova August 21, 2020

Thanks! I'll try it

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events