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