Uploaded image for project: 'Confluence Cloud'
  1. Confluence Cloud
  2. CONFCLOUD-40562

Expand macros in multiple future macros only expand properly for last future macro invoked

    XMLWordPrintable

Details

    Description

      NOTE: This bug report is for Confluence Cloud. Using Confluence Server? See the corresponding bug report.

      When a page contains multiple instances of the future macro which contain expand macros, only the expand macros in the last future macro invoked expand properly. Expand macros on the other (not-invoked-last) future briefly expand then immediately de-expand.

      Why Confluence Expand macro fails:
      Confluence expand macro binds expand-control elements with "click" and "keyup" events when expand-control found on a page. In case of future macro, since it loads asynchronously, binding occurs multiple times for the expand control which loads first.

      Proposed Fix:
      Confluence expand macro shall unbound all events before binding to events, so that events already bound to elements will be cleared. And then bind events to elements afresh.

      $elements.length && $elements.unbind(eventNames); // FIX: unbound events before binding
      $elements.length && $elements.bind(eventNames, helper.createToggleFunction(eventMatcher));
      

      With this fix put in place for confluence expand macro, it works well with multiple expands with or without future macro.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              b6c1d371603e Sunita Patro {Appfire}
              Votes:
              6 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: