This commit is contained in:
Usman Nasir
2019-12-30 14:48:10 +05:00
parent 69811b634c
commit 23ce41a5da
2 changed files with 14 additions and 1 deletions

View File

@@ -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;

View File

@@ -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>