diff options
author | cash <cash.costello@gmail.com> | 2011-06-18 22:06:40 -0400 |
---|---|---|
committer | cash <cash.costello@gmail.com> | 2011-06-18 22:06:40 -0400 |
commit | 780d9cb45f90158fdb843c41c8c1203ebdb06a3f (patch) | |
tree | c2a482d97391dfad02f14e090a8a4c40795627de /mod/embed/views | |
parent | aeb88b95d16ff1da7e2ce8fadde0eab1f4653d8b (diff) | |
download | elgg-780d9cb45f90158fdb843c41c8c1203ebdb06a3f.tar.gz elgg-780d9cb45f90158fdb843c41c8c1203ebdb06a3f.tar.bz2 |
added back tab switching
Diffstat (limited to 'mod/embed/views')
-rw-r--r-- | mod/embed/views/default/embed/tabs.php | 4 | ||||
-rw-r--r-- | mod/embed/views/default/js/embed/embed.php | 15 |
2 files changed, 17 insertions, 2 deletions
diff --git a/mod/embed/views/default/embed/tabs.php b/mod/embed/views/default/embed/tabs.php index a148ece9f..3f377fee5 100644 --- a/mod/embed/views/default/embed/tabs.php +++ b/mod/embed/views/default/embed/tabs.php @@ -16,7 +16,7 @@ foreach ($sections as $section_id => $section_info) { $tab = array( 'title' => $section_info['name'], 'url' => '#', - 'url_class' => 'embed_section', + 'url_class' => 'embed-section', 'url_id' => $section_id, ); @@ -31,7 +31,7 @@ if ($upload_sections) { $tabs[] = array( 'title' => elgg_echo('embed:upload'), 'url' => '#', - 'url_class' => 'embed_section', + 'url_class' => 'embed-section', 'url_id' => 'upload', 'selected' => ($active_section == 'upload') ); diff --git a/mod/embed/views/default/js/embed/embed.php b/mod/embed/views/default/js/embed/embed.php index b709af05e..3b398af3a 100644 --- a/mod/embed/views/default/js/embed/embed.php +++ b/mod/embed/views/default/js/embed/embed.php @@ -15,6 +15,8 @@ elgg.embed.init = function() { // special pagination helper for lightbox $('.embed-wrapper .elgg-pagination a').live('click', elgg.embed.pagination); + + $('.embed-section').live('click', elgg.embed.loadTab); } /** @@ -50,4 +52,17 @@ elgg.embed.pagination = function(event) { event.preventDefault(); } +/** + * Loads an embed tab + * + * @param {Object} event + * @return void + */ +elgg.embed.loadTab = function(event) { + var section = $(this).attr('id'); + var url = elgg.config.wwwroot + 'embed/embed?active_section=' + section; + $('.embed-wrapper').parent().load(url); + event.preventDefault(); +} + elgg.register_hook_handler('init', 'system', elgg.embed.init); |