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

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3, 2.4.1
    • Fix Version/s: 2.5
    • Component/s: Navigation
    • Labels:
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull Master Branch:
      wip-MDL-36287-m25

      Description

      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

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    14/May/13