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

Details

    • Sub-task
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.3, 2.4.1
    • 2.5
    • 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.

    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

      Attachments

        Issue Links

          Activity

            People

              samhemelryk Sam Hemelryk
              dobedobedoh Andrew Lyons
              Andrew Lyons Andrew Lyons
              Damyon Wiese Damyon Wiese
              Mark Nelson Mark Nelson
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                14/May/13