aboutsummaryrefslogtreecommitdiff
path: root/js/lib/elgglib.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib/elgglib.js')
-rw-r--r--js/lib/elgglib.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/js/lib/elgglib.js b/js/lib/elgglib.js
index f2545fb6c..9a372738d 100644
--- a/js/lib/elgglib.js
+++ b/js/lib/elgglib.js
@@ -379,4 +379,19 @@ elgg.getSelectorFromUrlFragment = function(url) {
}
}
return '';
-}; \ No newline at end of file
+};
+
+/**
+ * Triggers the init hook when the library is ready
+ *
+ * Current requirements:
+ * - DOM is ready
+ * - languages loaded
+ *
+ */
+elgg.initWhenReady = function() {
+ if (elgg.config.languageReady && elgg.config.domReady) {
+ elgg.trigger_hook('init', 'system');
+ elgg.trigger_hook('ready', 'system');
+ }
+} \ No newline at end of file