Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-79064

Improve modal support for native promises

XMLWordPrintable

      Whilst working on MDL-78324 I found myself reusing the same import time and time again and felt that we should finally just update core/str to have a getString and getStrings which return a native promise.

      To get this to wokr, I needed to add support to core/modal::asyncSet for native promises.

      Essentially this change involves:

      • creating a new getString and getStrings method to replace the current onces
      • call these from get_string and get_strings and wrap the return values in jQuery Promises
      • update core/modal to support the native promise
      • find out if anything else needs updating
      • encourage people to use the native

      Why should we use the native Promise instead of the jQuery Promise? Because the jQuery behaviour pre-dates the Promise standard and behaves differently in some weird but important cases. We should also seek to move away from unnecessary use of jQuery to reduce our reliance upon the framework.

            dobedobedoh Andrew Lyons
            dobedobedoh Andrew Lyons
            Glyn (Mathew) May Glyn (Mathew) May
            Jun Pataleta Jun Pataleta
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 3 hours, 17 minutes
                1d 3h 17m

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