MDL-68409 js: Add setButtonText modal helper
[moodle.git] / lib / amd / src / modal_factory.js
index 65c8854..a7d070d 100644 (file)
@@ -185,6 +185,12 @@ define(['jquery', 'core/modal_events', 'core/modal_registry', 'core/modal',
                     modal.setFooter(modalConfig.footer);
                 }
 
+                if (modalConfig.buttons) {
+                    Object.entries(modalConfig.buttons).forEach(function([key, value]) {
+                        modal.setButtonText(key, value);
+                    });
+                }
+
                 if (isLarge) {
                     modal.setLarge();
                 }