Merge pull request #16013 from nextcloud/versions-preview-string-id

fix previews of versions with non numeric version ids
This commit is contained in:
Roeland Jago Douma 2019-06-25 21:21:50 +02:00 committed by GitHub
commit 11b71a143e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 6 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
<li data-revision="{{timestamp}}">
<li data-revision="{{id}}">
<div>
<div class="preview-container">
<img class="preview" src="{{previewUrl}}" width="44" height="44"/>

View File

@ -68,7 +68,7 @@
version.fileId = fileId;
version.name = name;
version.timestamp = parseInt(moment(new Date(version.timestamp)).format('X'), 10);
version.id = parseInt(OC.basename(version.href), 10);
version.id = OC.basename(version.href);
version.size = parseInt(version.size, 10);
version.user = user;
version.client = client;

View File

@ -55,7 +55,7 @@
var url = OC.generateUrl('/apps/files_versions/preview');
var params = {
file: this.get('fullPath'),
version: this.get('timestamp')
version: this.get('id')
};
return url + '?' + OC.buildQueryString(params);
},

View File

@ -156,7 +156,7 @@ import Template from './templates/template.handlebars';
var preview = OC.MimeType.getIconUrl(version.get('mimetype'));
var img = new Image();
img.onload = function () {
$('li[data-revision=' + version.get('timestamp') + '] .preview').attr('src', version.getPreviewUrl());
$('li[data-revision=' + version.get('id') + '] .preview').attr('src', version.getPreviewUrl());
};
img.src = version.getPreviewUrl();