2e7160aafa9217b00f323911030c03da1e0c83ad
[friendica.git/.git] / view / theme / frio / js / mod_photos.js
1
2 $(document).ready(function() {
3
4         $('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
5                 var selstr;
6                 $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
7                         selstr = $(this).text();
8                         $('#jot-perms-icon').removeClass('unlock').addClass('lock');
9                         $('#jot-public').hide();
10                 });
11                 if(selstr == null) { 
12                         $('#jot-perms-icon').removeClass('lock').addClass('unlock');
13                         $('#jot-public').show();
14                 }
15
16         }).trigger('change');
17
18         // Click event listener for the album edit link/button.
19         $("body").on('click', '#album-edit-link', function() {
20                 var modalUrl = $(this).attr("data-modal-url");
21
22                 if (typeof modalUrl !== "undefined") {
23                         addToModal(modalUrl, 'photo-album-edit-wrapper');
24                 }
25         });
26
27         // Click event listener for the album drop link/button.
28         $("body").on('click', '#album-drop-link', function() {
29                 var modalUrl = $(this).attr("data-modal-url");
30
31                 if (typeof modalUrl !== "undefined") {
32                         addToModal(modalUrl);
33                 }
34         });
35 });
36
37 $(window).load(function() {
38         // Get picture dimensions
39         var pheight = $("#photo-photo img").height();
40         var pwidth = $("#photo-photo img").width();
41
42         // Append the diminsons of the picture to the css of the photo-photo div
43         // we do this to make it possible to have overlay navigation buttons for the photo
44         $("#photo-photo").css({
45                 "width": pwidth,
46                 "height": pheight
47         });
48 });