Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-35672 META JavaScript performance issues
  3. MDL-36287

navigation.js uses node.on when it could use delegation for wire function

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.5
    • 2.3, 2.4.1
    • Navigation
    • MOODLE_23_STABLE, MOODLE_24_STABLE
    • MOODLE_25_STABLE
    • wip-MDL-36287-m25
    • Hide

      There should be no visible changes, this is a performance issue.

      1. Play with the navigation.
      2. Expand things by AJAX.
      3. Try both mouse and keyboard navigation.
      Show
      There should be no visible changes, this is a performance issue. Play with the navigation. Expand things by AJAX. Try both mouse and keyboard navigation.

      I think that this is another candidate for event delegation rather than an Node.on.
      The wire function is called for each expandable branch and just sets up calls to ajaxLoad if the node is expandable. It should be possible to determine whether a node is expandable in the ajaxLoad function and instead to delegate to all tree items.

      I'm not familiar enough with the code to do it right now, and I know that you're already working in this area Sam so I point the finger of doom at you

            samhemelryk Sam Hemelryk
            dobedobedoh Andrew Lyons
            Andrew Lyons Andrew Lyons
            Damyon Wiese Damyon Wiese
            Mark Nelson Mark Nelson
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.