moodle/lib/amd/build/modal_registry.min.js
Ryan Wyllie 0531ce1a29 MDL-57280 javascript: add modal registry
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.
2017-02-27 01:05:44 +00:00

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}});