File size: 2,352 Bytes
7f88cfb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
$(document).ready(function() {
	$(".popup").fancybox(fancyboxoptions("ajax"));
	$(".popup.iframe").fancybox(fancyboxoptions("iframe"));
	$(".popup-image").fancybox(fancyboxoptions("photo"));

	$(".datatable.clickable tr td").bind("click", function(e) {
		var $clicked = $(e.target);
		if (!$clicked.closest("a").get(0)){
			var $this = $(this).closest("tr");
			console.log($this.find("a.rowaction"));
			$this.find("a.rowaction:first").click();
			console.log($this.find("a.rowaction:first").html())
		}
	})


	$(".deletebtn").click(function(){
		return confirm("Are you sure you want to delete this record?");
	})
});
var transitionSpeed = 300;
function fancyboxoptions(type) {
	if (type) {
		var fancybox_popup = {
			'type'			:	type,
			'transitionIn'	:	'elastic',
			'transitionOut'	:	'elastic',
			//'modal'			: 	true,
			'scrolling'		:	 'no',
			'autoDimensions':	false,
			'autoScale'		:	false,
			'centerOnScroll':	true,
			'titleShow'		:	true,
			'titleFormat'	:	function(titleStr, currentArray, currentIndex, currentOpts) {
//+ $(currentOpts.orig).attr("class")
				var $this = currentOpts.orig;

				var $title = currentOpts.orig.next(".link-title").html();
				if (!$title) {
					$title = currentOpts.orig.attr("title");
				}

				return '<div>' + $title + '</div>';
			},
			'speedIn'		:   transitionSpeed,
			'speedOut'		:	transitionSpeed,
			'overlayShow'	:	true,
			'overlayOpacity':	0.8,
			'overlayColor'	:	"#fff",
			'padding'		:	0,
			'margin'		:	0,
			//'showCloseButton':  false,
			'width'			:   700,
			'height'		:   420,
			'showNavArrows'	:	false,
			'onComplete'	:   function() {

			},
			'onClosed'	    :   function() {

			}
		};
		var fancybox_popup_image = {
			'transitionIn'	:	'elastic',
			'transitionOut'	:	'elastic',
			//'modal'			: 	true,
			'centerOnScroll':	true,
			'titleShow'		:	true,
			titlePosition : 'over',
			'titleFormat'	:	function(titleStr, currentArray, currentIndex, currentOpts) {

				return '<div id="fancybox-title-over">' + $(currentOpts.orig).attr("alt") + '</div>';
			},
			'speedIn'		:   transitionSpeed,
			'speedOut'		:	transitionSpeed,
			'overlayShow'	:	true,
			'overlayOpacity':	0.7,
			'overlayColor'	:	"#000",
			'padding'		:	0,
			'margin'		:	0
		};

		if (type == "photo") {
			return fancybox_popup_image;
		} else {
			return fancybox_popup;
		}
	} else {
		return "";
	}
}