Merge pull request #16013 from nextcloud/versions-preview-string-id
fix previews of versions with non numeric version ids
This commit is contained in:
commit
11b71a143e
6 changed files with 4 additions and 4 deletions
Binary file not shown.
Binary file not shown.
|
@ -1,4 +1,4 @@
|
||||||
<li data-revision="{{timestamp}}">
|
<li data-revision="{{id}}">
|
||||||
<div>
|
<div>
|
||||||
<div class="preview-container">
|
<div class="preview-container">
|
||||||
<img class="preview" src="{{previewUrl}}" width="44" height="44"/>
|
<img class="preview" src="{{previewUrl}}" width="44" height="44"/>
|
||||||
|
|
|
@ -68,7 +68,7 @@
|
||||||
version.fileId = fileId;
|
version.fileId = fileId;
|
||||||
version.name = name;
|
version.name = name;
|
||||||
version.timestamp = parseInt(moment(new Date(version.timestamp)).format('X'), 10);
|
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.size = parseInt(version.size, 10);
|
||||||
version.user = user;
|
version.user = user;
|
||||||
version.client = client;
|
version.client = client;
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
var url = OC.generateUrl('/apps/files_versions/preview');
|
var url = OC.generateUrl('/apps/files_versions/preview');
|
||||||
var params = {
|
var params = {
|
||||||
file: this.get('fullPath'),
|
file: this.get('fullPath'),
|
||||||
version: this.get('timestamp')
|
version: this.get('id')
|
||||||
};
|
};
|
||||||
return url + '?' + OC.buildQueryString(params);
|
return url + '?' + OC.buildQueryString(params);
|
||||||
},
|
},
|
||||||
|
|
|
@ -156,7 +156,7 @@ import Template from './templates/template.handlebars';
|
||||||
var preview = OC.MimeType.getIconUrl(version.get('mimetype'));
|
var preview = OC.MimeType.getIconUrl(version.get('mimetype'));
|
||||||
var img = new Image();
|
var img = new Image();
|
||||||
img.onload = function () {
|
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();
|
img.src = version.getPreviewUrl();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue