$content .= elgg_view('embed/tabs', $vars);
$offset = max(0, get_input('offset', 0));
- $limit = get_input('limit', 10);
+ $limit = get_input('limit', 5);
// build the items and layout.
if ($active_section == 'upload' || array_key_exists($active_section, $sections)) {
if (!isset($embed_info['items']) || !is_array($embed_info['items']) || !count($embed_info['items'])) {
$content .= elgg_echo('embed:no_section_content');
} else {
+
elgg_push_context('widgets');
$content .= elgg_view_entity_list($embed_info['items'], array(
'full_view' => false,
+ 'count' => $embed_info['count'],
+ 'pagination' => true,
+ 'position' => 'before',
+ 'offset' => $offset,
+ 'limit' => $limit,
));
elgg_pop_context();
var textAreaId = class.substr(class.indexOf('embed-control-') + "embed-control-".length);
elgg.embed.textAreaId = textAreaId;
});
+
+ // special pagination helper for lightbox
+ $('.embed-wrapper .elgg-pagination a').live('click', elgg.embed.pagination);
}
/**
event.preventDefault();
}
+/**
+ * Loads the next chunk of content within the lightbox
+ *
+ * @param {Object} event
+ * @return void
+ */
+elgg.embed.pagination = function(event) {
+ $('.embed-wrapper').parent().load($(this).attr('href'));
+ event.preventDefault();
+}
+
elgg.register_hook_handler('init', 'system', elgg.embed.init);