1
0
mirror of https://github.com/S2-/gitlit synced 2025-08-02 20:30:05 +02:00

fix lock/unlock refresh

This commit is contained in:
s2
2019-06-12 15:52:58 +02:00
parent 36f71da17a
commit 9eae13612e

View File

@@ -43,16 +43,18 @@
}
if (notification.event && notification.event === 'unlock') {
$('[data-file="' + notification.file + '"].js-unlock').hide();
$('[data-file="' + notification.file + '"].js-lock').show();
let file = notification.file.replace(/\\/g, '\\\\');
$('[data-file="' + file + '"].js-unlock').hide();
$('[data-file="' + file + '"].js-lock').show();
let text = 'not locked';
$('[data-file="' + notification.file + '"]').parent().prev().text(text);
$('[data-file="' + file + '"]').parent().prev().text(text);
}
if (notification.event && notification.event === 'lock') {
$('[data-file="' + notification.file + '"].js-lock').hide();
$('[data-file="' + notification.file + '"].js-unlock').show();
let file = notification.file.replace(/\\/g, '\\\\');
$('[data-file="' + file + '"].js-lock').hide();
$('[data-file="' + file + '"].js-unlock').show();
let text = notification.data.owner.name + ' (id: ' + notification.data.id + ')';
$('[data-file="' + notification.file + '"]').parent().prev().text(text);
$('[data-file="' + file + '"]').parent().prev().text(text);
}
});