filemanager: Fix state issue with editor

This commit is contained in:
Johannes Zellner
2021-03-18 16:43:33 +01:00
parent 12e32cc8ff
commit 9161e5f7e8
2 changed files with 9 additions and 3 deletions

View File

@@ -858,14 +858,20 @@ app.controller('FileManagerController', ['$scope', '$translate', '$timeout', 'Cl
$('#textEditorCloseModal').modal('hide');
},
onClose: function () {
$scope.view = 'fileTree';
location.hash = $scope.cwd;
$('#textEditorCloseModal').modal('hide');
},
saveAndClose: function () {
$scope.textEditor.save(function () {
$scope.textEditor.close();
$scope.textEditor.onClose();
});
},
maybeClose: function () {
if (!$scope.textEditor.unsaved) return $scope.textEditor.close();
if (!$scope.textEditor.unsaved) return $scope.textEditor.onClose();
$('#textEditorCloseModal').modal('show');
},
};