From 3150236682aa55bd43ff301bc5b7517c84d81909 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Tue, 19 Dec 2023 17:08:43 +0100 Subject: [PATCH] fix: Preserve lock data in file info model MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When we obtain the model trough getModelForFile which reads the properties from the table row element, which does not preserve already fetched lock information otherwise. Signed-off-by: Julius Härtl --- js/files.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/js/files.js b/js/files.js index 4399d5a9..870cd4be 100644 --- a/js/files.js +++ b/js/files.js @@ -43,6 +43,18 @@ return data }) + var oldElementToFile = fileList.elementToFile + fileList.elementToFile = function($el) { + var fileData = oldElementToFile.apply(this, arguments) + fileData.locked = $el.data('locked') + fileData.lockOwnerType = $el.data('lock-owner-type') + fileData.lockOwnerEditor = $el.data('lock-owner-editor') + fileData.lockOwner = $el.data('lock-owner') + fileData.lockOwnerDisplayname = $el.data('lock-owner-displayname') + fileData.lockTime = $el.data('lock-time') + return fileData + } + var oldCreateRow = fileList._createRow fileList._createRow = function(fileData) { var $tr = oldCreateRow.apply(this, arguments)