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

Disabledif JavaScript is very inefficient

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.6
    • 2.3.3, 2.4
    • Forms Library
    • MOODLE_23_STABLE, MOODLE_24_STABLE
    • MOODLE_26_STABLE
    • MDL-35674-form-dependencies
    • Hide

      Note
      This patch changes javascript libraries, so be sure to purge caches and do a browser shift-reload after applying.

      Performance testing:
      Copy the attached bigform_test.php to the moodle root and visit with a browser.
      It will be very slow to load and handle events. With the patch it's much faster.

      Regression testing:
      This needs to be tested on as many browsers as possible.

      Some good pages to test:

      • attached bigform_test.php (copy to moodle root)
        Each form group contains an Enable checkbox which enables/disables the entire group. Verify that this interacts properly with the datetime control enable boxes.
      • attached samstest.php (copy to moodle root)
        In particular, verify that nested dependencies work properly:
        • In the "Disabled if things change" section:
          • Unchecking "Test checkbox" should disable the Basic and Array groups.
          • Clearing the text in the first textfield should disable the Basic and Array groups.
          • Adding text to the second textfield should disable the Basic and Array groups.
          • Changing the select to "No" should disable the Basic and Array groups.
        • In the Stacked Chain, each item disables/enables all the items below it.
        • For the Date/Duration selectors, the enable box should enable/disable the entire selector.

      Other moodle pages:

      • Backup UI
      • XML Grade upload
      • Calendar event add
      • Forum settings page
      • Assignment settings page
      Show
      Note This patch changes javascript libraries, so be sure to purge caches and do a browser shift-reload after applying. Performance testing: Copy the attached bigform_test.php to the moodle root and visit with a browser. It will be very slow to load and handle events. With the patch it's much faster. Regression testing: This needs to be tested on as many browsers as possible. Some good pages to test: attached bigform_test.php (copy to moodle root) Each form group contains an Enable checkbox which enables/disables the entire group. Verify that this interacts properly with the datetime control enable boxes. attached samstest.php (copy to moodle root) In particular, verify that nested dependencies work properly: In the "Disabled if things change" section: Unchecking "Test checkbox" should disable the Basic and Array groups. Clearing the text in the first textfield should disable the Basic and Array groups. Adding text to the second textfield should disable the Basic and Array groups. Changing the select to "No" should disable the Basic and Array groups. In the Stacked Chain, each item disables/enables all the items below it. For the Date/Duration selectors, the enable box should enable/disable the entire selector. Other moodle pages: Backup UI XML Grade upload Calendar event add Forum settings page Assignment settings page

      This is best seen by going to the backup settings page for a large course in internet explorer. There are lots of checkboxes that all depend on each other.

      lib/form/form.js uses lots of separate node.on event handlers. Using a single delegate event handler would be much kinder to web browsers.

        1. bigform_test.php
          1 kB
        2. ChromeCheckbox.png
          ChromeCheckbox.png
          32 kB
        3. form.js
          20 kB
        4. samstest.php
          5 kB

            mpetrowi Matt Petro
            timhunt Tim Hunt
            Andrew Lyons Andrew Lyons
            Dan Poltawski Dan Poltawski
            Andrew Davis Andrew Davis
            Votes:
            17 Vote for this issue
            Watchers:
            21 Start watching this issue

              Created:
              Updated:
              Resolved:

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