Move mod/lockview to Module\PermissionTooltip

- Add explicit type parameter to lockview() in main.js
This commit is contained in:
Hypolite Petovan 2020-07-26 18:35:02 -04:00
parent 639e2b3892
commit d7b5674476
20 changed files with 158 additions and 45 deletions

View file

@ -750,26 +750,23 @@ function getPosition(e) {
var lockvisible = false;
function lockview(event,id) {
function lockview(event, type, id) {
event = event || window.event;
cursor = getPosition(event);
if (lockvisible) {
lockviewhide();
lockvisible = false;
$('#panel').hide();
} else {
lockvisible = true;
$.get('lockview/' + id, function(data) {
$('#panel').html(data);
$('#panel').css({'left': cursor.x + 5 , 'top': cursor.y + 5});
$('#panel').show();
$.get('permission/tooltip/' + type + '/' + id, function(data) {
$('#panel')
.html(data)
.css({'left': cursor.x + 5 , 'top': cursor.y + 5})
.show();
});
}
}
function lockviewhide() {
lockvisible = false;
$('#panel').hide();
}
function post_comment(id) {
unpause();
commentBusy = true;
@ -940,14 +937,6 @@ function groupChangeMember(gid, cid, sec_token) {
});
}
function profChangeMember(gid,cid) {
$('body .fakelink').css('cursor', 'wait');
$.get('profperm/' + gid + '/' + cid, function(data) {
$('#prof-update-wrapper').html(data);
$('body .fakelink').css('cursor', 'auto');
});
}
function contactgroupChangeMember(checkbox, gid, cid) {
let url;
// checkbox.checked is the checkbox state after the click