diff --git a/src/filemanager.html b/src/filemanager.html
index ba317e857..f74f365e5 100644
--- a/src/filemanager.html
+++ b/src/filemanager.html
@@ -57,16 +57,13 @@
-
{{ entryRemove.error }}
-
Really delete {{ entryRemove.entry.fileName }}
+
Really delete {{ entryRemove.entry.fileName }}?
@@ -77,15 +74,14 @@
diff --git a/src/js/filemanager.js b/src/js/filemanager.js
index 520b2ec09..103383a3a 100644
--- a/src/js/filemanager.js
+++ b/src/js/filemanager.js
@@ -146,16 +146,21 @@ app.controller('FileManagerController', ['$scope', 'Client', function ($scope, C
$scope.newDirectory.name = '';
$scope.newDirectory.busy = false;
+ $scope.newDirectoryForm.$setUntouched();
+ $scope.newDirectoryForm.$setPristine();
+
$('#newDirectoryModal').modal('show');
},
submit: function () {
$scope.newDirectory.busy = true;
+ $scope.newDirectory.error = null;
var filePath = sanitize($scope.cwd + '/' + $scope.newDirectory.name);
Client.filesCreateDirectory($scope.appId, filePath, function (error, result) {
$scope.newDirectory.busy = false;
+ if (error && error.statusCode === 409) return $scope.newDirectory.error = 'Already exists';
if (error) return Client.error(error);
console.log('create direcotory', result);
@@ -277,4 +282,11 @@ app.controller('FileManagerController', ['$scope', 'Client', function ($scope, C
}
init();
+
+ // setup all the dialog focus handling
+ ['newDirectoryModal'].forEach(function (id) {
+ $('#' + id).on('shown.bs.modal', function () {
+ $(this).find("[autofocus]:first").focus();
+ });
+ });
}]);