Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-40562

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

XMLWordPrintable

      NOTE: This bug report is for Confluence Server. Using Confluence Cloud? 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.

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

                Created:
                Updated: