mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-03-13 15:50:15 +01:00
feature: ref https://github.com/usmannasir/cyberpanel/issues/189 create file via enter
This commit is contained in:
@@ -25,6 +25,10 @@ fileManager.config(['$interpolateProvider', function ($interpolateProvider) {
|
||||
|
||||
fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader, $window) {
|
||||
|
||||
$('form').submit(function(e){
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$(document.body).click(function () {
|
||||
rightClickNode.style.display = "none";
|
||||
});
|
||||
@@ -921,6 +925,15 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
$('#showCreateFile').modal('show');
|
||||
};
|
||||
|
||||
$scope.createFileEnter = function($event){
|
||||
var keyCode = $event.which || $event.keyCode;
|
||||
if (keyCode === 13) {
|
||||
$scope.htmlEditorLoading = false;
|
||||
$scope.createNewFile();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$scope.createNewFile = function () {
|
||||
|
||||
var completePathForFile = $scope.currentPath + "/" + $scope.newFileName;
|
||||
|
||||
@@ -372,7 +372,7 @@
|
||||
<form action="/">
|
||||
<div class="form-group">
|
||||
<label>{% trans "New File Name" %}</label>
|
||||
<input ng-model="newFileName" type="text" class="form-control" >
|
||||
<input ng-keypress="createFileEnter($event)" ng-model="newFileName" type="text" class="form-control" >
|
||||
<small class="form-text text-muted">{% trans "File will be created in your current directory, if it already exists it will not overwirte." %}</small>
|
||||
</div>
|
||||
<button type="button" ng-click="createNewFile()" class="btn btn-primary">{% trans "Create File" %}</button>
|
||||
|
||||
Reference in New Issue
Block a user