Make texteditor fullscreen and add saving without closing action
This commit is contained in:
@@ -73,6 +73,7 @@ app.controller('FileManagerController', ['$scope', '$timeout', 'Client', functio
|
||||
$scope.dropToBody = false;
|
||||
$scope.sortAsc = true;
|
||||
$scope.sortProperty = 'fileName';
|
||||
$scope.view = 'fileTree';
|
||||
|
||||
$scope.owners = [
|
||||
{ name: 'cloudron', value: 1000 },
|
||||
@@ -443,7 +444,8 @@ app.controller('FileManagerController', ['$scope', '$timeout', 'Client', functio
|
||||
// clear model if any
|
||||
if ($scope.textEditor.editor && $scope.textEditor.editor.getModel()) $scope.textEditor.editor.setModel(null);
|
||||
|
||||
$('#textEditorModal').modal('show');
|
||||
$scope.view = 'textEditor';
|
||||
// document.getElementById('textEditorModal').style['display'] = 'flex';
|
||||
|
||||
var filePath = sanitize($scope.cwd + '/' + entry.fileName);
|
||||
var language = getLanguage(entry.fileName);
|
||||
@@ -465,7 +467,7 @@ app.controller('FileManagerController', ['$scope', '$timeout', 'Client', functio
|
||||
});
|
||||
},
|
||||
|
||||
submit: function () {
|
||||
save: function (callback) {
|
||||
$scope.textEditor.busy = true;
|
||||
|
||||
var newContent = $scope.textEditor.editor.getValue();
|
||||
@@ -477,8 +479,18 @@ app.controller('FileManagerController', ['$scope', '$timeout', 'Client', functio
|
||||
|
||||
if (error) return Client.error(error);
|
||||
|
||||
$('#textEditorModal').modal('hide');
|
||||
if (callback) callback();
|
||||
});
|
||||
},
|
||||
|
||||
saveAndClose: function () {
|
||||
$scope.textEditor.save(function () {
|
||||
$scope.textEditor.close();
|
||||
});
|
||||
},
|
||||
|
||||
close: function () {
|
||||
$scope.view = 'fileTree';
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user