Blame view

mustache/app/views/assets/scripts/gallery.js 891 Bytes
5a739853   patrick.he   commit
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
  jQuery(function($) {
  	var $overflow = '';
  	var colorbox_params = {
  		rel: 'colorbox',
  		reposition:true,
  		scalePhotos:true,
  		scrolling:false,
  		previous:'<i class="ace-icon fa fa-arrow-left"></i>',
  		next:'<i class="ace-icon fa fa-arrow-right"></i>',
  		close:'&times;',
  		current:'{current} of {total}',
  		maxWidth:'100%',
  		maxHeight:'100%',
  		onOpen:function(){
  			$overflow = document.body.style.overflow;
  			document.body.style.overflow = 'hidden';
  		},
  		onClosed:function(){
  			document.body.style.overflow = $overflow;
  		},
  		onComplete:function(){
  			$.colorbox.resize();
  		}
  	};
  
  	$('.ace-thumbnails [data-rel="colorbox"]').colorbox(colorbox_params);
  	$("#cboxLoadingGraphic").html("<i class='ace-icon fa fa-spinner orange fa-spin'></i>");//let's add a custom loading icon
  	
  	
  	$(document).one('ajaxloadstart.page', function(e) {
  		$('#colorbox, #cboxOverlay').remove();
     });
  })