Skip to content

Commit

Permalink
fix: Preserve lock data in file info modelbtain
Browse files Browse the repository at this point in the history
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 <jus@bitgrid.net>
  • Loading branch information
juliusknorr committed Dec 19, 2023
1 parent 0401fb1 commit 8b53f0b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions js/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8b53f0b

Please sign in to comment.