1
1
Fork 0
friendica_2019-12_sharedHos.../view/theme/frio/js/mod_photos.js
Hypolite Petovan 5dd6e6b5fb Reworked /photos module without App->error
- Moved confirm dialogs to photos_content()
- Removed comments/interactions from photo edit page
2019-05-01 19:36:14 -04:00

49 lines
1.4 KiB
JavaScript

$(document).ready(function() {
$('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
var selstr;
$('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
selstr = $(this).text();
$('#jot-perms-icon').removeClass('unlock').addClass('lock');
$('#jot-public').hide();
});
if(selstr == null) {
$('#jot-perms-icon').removeClass('lock').addClass('unlock');
$('#jot-public').show();
}
}).trigger('change');
// Click event listener for the album edit link/button.
$("body").on('click', '#album-edit-link', function() {
var modalUrl = $(this).attr("data-modal-url");
if (typeof modalUrl !== "undefined") {
addToModal(modalUrl, 'photo-album-edit-wrapper');
}
});
// Click event listener for the album drop link/button.
$("body").on('click', '#album-drop-link', function() {
var modalUrl = $(this).attr("data-modal-url");
if (typeof modalUrl !== "undefined") {
addToModal(modalUrl);
}
});
});
$(window).load(function() {
// Get picture dimensions
var pheight = $("#photo-photo img").height();
var pwidth = $("#photo-photo img").width();
// Append the diminsons of the picture to the css of the photo-photo div
// we do this to make it possible to have overlay navigation buttons for the photo
$("#photo-photo").css({
"width": pwidth,
"height": pheight
});
});