mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
0531ce1a29
Add a modal registry for the types and make the factory use it to allow code to register modal types at run time and use the factory for non-core modals.
1 line
370 B
JavaScript
1 line
370 B
JavaScript
define(["core/notification"],function(a){var b={},c=function(a){return b[a]},d=function(d,e,f){c(d)&&a.exception({message:"Modal of type '"+d+"' is already registered"}),e&&"function"==typeof e||a.exception({message:"You must provide a modal module"}),f||a.exception({message:"You must provide a modal template"}),b[d]={module:e,template:f}};return{register:d,get:c}}); |