From 9eae13612e05b3774f25d422332118f3a7dad3c2 Mon Sep 17 00:00:00 2001 From: s2 Date: Wed, 12 Jun 2019 15:52:58 +0200 Subject: [PATCH] fix lock/unlock refresh --- app/js/index.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/js/index.js b/app/js/index.js index 41dc6a8d..485ed83e 100644 --- a/app/js/index.js +++ b/app/js/index.js @@ -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); } });