diff options
author | Sem <sembrestels@riseup.net> | 2012-08-28 18:43:39 +0200 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2012-08-28 18:43:39 +0200 |
commit | f3f3561b7ce6462e4f75649bab874b3112867dc3 (patch) | |
tree | d017b2d5aff45549d2a08c2558553c51edb10a83 /js/lib/ui.js | |
parent | afa701d29525b8ebd3782d3efa6838c14ff9cc54 (diff) | |
parent | 9ccbd106a87a1742a61cc4df0e9ead921046772a (diff) | |
download | elgg-f3f3561b7ce6462e4f75649bab874b3112867dc3.tar.gz elgg-f3f3561b7ce6462e4f75649bab874b3112867dc3.tar.bz2 |
Merge branch '1.8' of git://github.com/Elgg/Elgg into lorea-preprod
Diffstat (limited to 'js/lib/ui.js')
-rw-r--r-- | js/lib/ui.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/js/lib/ui.js b/js/lib/ui.js index c26cbe389..616e71d54 100644 --- a/js/lib/ui.js +++ b/js/lib/ui.js @@ -257,7 +257,7 @@ elgg.ui.loginHandler = function(hook, type, params, options) { * @return void */ elgg.ui.initDatePicker = function() { - if ($('.elgg-input-date').length) { + var loadDatePicker = function() { $('.elgg-input-date').datepicker({ // ISO-8601 dateFormat: 'yy-mm-dd', @@ -273,9 +273,21 @@ elgg.ui.initDatePicker = function() { } } }); + }; + + if ($('.elgg-input-date').length && elgg.get_language() == 'en') { + loadDatePicker(); + } else if ($('.elgg-input-date').length) { + elgg.get({ + url: elgg.config.wwwroot + 'vendors/jquery/i18n/jquery.ui.datepicker-'+ elgg.get_language() +'.js', + dataType: "script", + cache: true, + success: loadDatePicker, + error: loadDatePicker, // english language is already loaded. + }); } }; elgg.register_hook_handler('init', 'system', elgg.ui.init); elgg.register_hook_handler('init', 'system', elgg.ui.initDatePicker); -elgg.register_hook_handler('getOptions', 'ui.popup', elgg.ui.loginHandler);
\ No newline at end of file +elgg.register_hook_handler('getOptions', 'ui.popup', elgg.ui.loginHandler); |