1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-07 23:03:00 +03:00

File upload deletion complete & added extension handling

Also fixed issue with file editing on JS side
This commit is contained in:
Dan Brown
2016-10-23 13:36:45 +01:00
parent 867fc8be64
commit 7ee695d74a
6 changed files with 26 additions and 7 deletions

View File

@@ -674,6 +674,7 @@ module.exports = function (ngApp, events) {
if ($scope.editFile && !file.external) {
$scope.editFile.link = '';
}
$scope.editFile = false;
events.emit('success', 'Attachment details updated');
});
};
@@ -686,7 +687,7 @@ module.exports = function (ngApp, events) {
*/
function filesIndexOf(file) {
for (let i = 0; i < $scope.files.length; i++) {
if ($scope.files[i].id == file.id) return file.id;
if ($scope.files[i].id == file.id) return i;
}
return -1;
}