MDL-59384 core_modal: trigger bodyRendered event
authorSimey Lameze <simey@moodle.com>
Wed, 12 Jul 2017 11:57:22 +0000 (19:57 +0800)
committerSimey Lameze <simey@moodle.com>
Wed, 12 Jul 2017 11:57:22 +0000 (19:57 +0800)
Part of MDL-59333.

lib/amd/build/modal.min.js
lib/amd/build/modal_events.min.js
lib/amd/src/modal.js
lib/amd/src/modal_events.js

index 1b1e4fd..a469dda 100644 (file)
Binary files a/lib/amd/build/modal.min.js and b/lib/amd/build/modal.min.js differ
index e7980b7..9b2eaab 100644 (file)
Binary files a/lib/amd/build/modal_events.min.js and b/lib/amd/build/modal_events.min.js differ
index 36245c1..6cca43b 100644 (file)
@@ -240,6 +240,7 @@ define(['jquery', 'core/templates', 'core/notification', 'core/key_codes',
             // Just set the value if it's a string.
             body.html(value);
             Event.notifyFilterContentUpdated(body);
+            this.getRoot().trigger(ModalEvents.bodyRendered, this);
         } else {
             // Otherwise we assume it's a promise to be resolved with
             // html and javascript.
@@ -259,6 +260,7 @@ define(['jquery', 'core/templates', 'core/notification', 'core/key_codes',
                         }
                     }
                     Event.notifyFilterContentUpdated(body);
+                    this.getRoot().trigger(ModalEvents.bodyRendered, this);
                 }.bind(this));
             }.bind(this));
         }
index 1a1d9d5..bbd3979 100644 (file)
@@ -28,6 +28,7 @@ define([], function() {
         shown: 'modal:shown',
         hidden: 'modal:hidden',
         destroyed: 'modal:destroyed',
+        bodyRendered: 'modal:bodyRendered',
         // ModalSaveCancel events.
         save: 'modal-save-cancel:save',
         cancel: 'modal-save-cancel:cancel',