diff options
author | Brett Profitt <brett.profitt@gmail.com> | 2011-09-29 18:16:03 -0700 |
---|---|---|
committer | Brett Profitt <brett.profitt@gmail.com> | 2011-09-29 18:16:03 -0700 |
commit | bfdb9bb8a87a29038ba1ae25355684ae19678fdd (patch) | |
tree | a074e2d6bfa19c17b284c3950b4555cf584eabe2 /js/lib/elgglib.js | |
parent | 7be23080f34a8f92ca1f8d49c3aa0e6ce3472f4c (diff) | |
parent | a458ae4e0f8e5b19884860fead6e5f901b95eca4 (diff) | |
download | elgg-bfdb9bb8a87a29038ba1ae25355684ae19678fdd.tar.gz elgg-bfdb9bb8a87a29038ba1ae25355684ae19678fdd.tar.bz2 |
Merge branch 'master' of github.com:brettp/Elgg
Diffstat (limited to 'js/lib/elgglib.js')
-rw-r--r-- | js/lib/elgglib.js | 17 |
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 |