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

Adjust chooserdialogue to only generate and render the dialogue when it's required

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.3.2
    • Fix Version/s: 2.3.3
    • Component/s: JavaScript
    • Labels:
    • Testing Instructions:
      Hide

      With the console open:

      • [-] Turn editing on
      • [ ] Confirm that there were no errors in the JS console
      • [ ] Open the activity chooser
      • [ ] Confirm that there were no errors in the JS console
      • [ ] Confirm that the activity chooser appears correctly and functions as expected
      • [-] Open the inspector and find the Activity Chooser in the DOM
      • [ ] Confirm that the chooser HTML appears as expected
      • [ ] Confirm that the chooser HTML appears only once within the DOM
      Show
      With the console open: [-] Turn editing on [ ] Confirm that there were no errors in the JS console [ ] Open the activity chooser [ ] Confirm that there were no errors in the JS console [ ] Confirm that the activity chooser appears correctly and functions as expected [-] Open the inspector and find the Activity Chooser in the DOM [ ] Confirm that the chooser HTML appears as expected [ ] Confirm that the chooser HTML appears only once within the DOM
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-36023-master

      Description

      At present, the chooser dialogue generates M.core.dialogue (Y.overlay) in the setup_chooser_dialogue function. This is called in the child classes initializer even if the chooser is never displayed.

      I propose we modify this such that we still call setup_chooser_dialogue from the initializer, but when we actually display the dialogue for the first time, we actually instantiate the dialogue. This should reduce load time further.

      It should also make it easier to modify in the future to handle asynchronous loading of the dialogue's contents.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                3 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/Nov/12