aboutsummaryrefslogtreecommitdiff
path: root/views/default/js/photos/tidypics.php
blob: 20dcc403ed1a68e29060efd9f5a8a04038b6f84b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
/**
 *
 */

?>

elgg.provide('elgg.tidypics');

elgg.tidypics.init = function() {

	if ($.colorbox) {
		$(".elgg-gallery .tidypics-lightbox").colorbox({
			onComplete: function() {
				$('#cboxLoadedContent .elgg-page-topbar, #cboxLoadedContent .elgg-page-header, ' +
					'#cboxLoadedContent .elgg-page-footer, #cboxLoadedContent .elgg-sidebar').css('display', 'none');
				$('#cboxLoadedContent .elgg-layout').css('background-image', 'none');
			}
		});
	}

	$("#tidypics-sort").sortable({
		opacity: 0.7,
		revert: true,
		scroll: true
	});

	$('.elgg-form-photos-album-sort').submit(function() {
		var tidypics_guids = [];
		$("#tidypics-sort li").each(function(index) {
			tidypics_guids.push($(this).attr('id'));
		});
		$('input[name="guids"]').val(tidypics_guids.toString());
	});
};

elgg.register_hook_handler('init', 'system', elgg.tidypics.init);