slightly improve the media viewer widget

This commit is contained in:
Johannes Zellner
2020-11-04 13:03:36 +01:00
parent 20af9ed911
commit 1d7921a760
2 changed files with 7 additions and 5 deletions

View File

@@ -527,11 +527,13 @@ app.controller('FileManagerController', ['$scope', '$timeout', 'Client', functio
show: function (entry) {
var filePath = sanitize($scope.cwd + '/' + entry.fileName);
$scope.mediaViewer.entry = entry;
$scope.mediaViewer.type = Mimer().get(entry.fileName).split('/')[0];
$scope.mediaViewer.src = '';
Client.filesGet($scope.id, $scope.type, filePath, 'link', function (error, result) {
if (error) return Client.error(error);
$scope.mediaViewer.entry = entry;
$scope.mediaViewer.type = Mimer().get(entry.fileName).split('/')[0];
$scope.mediaViewer.src = result;
$('#mediaViewerModal').modal('show');