diff --git a/src/filemanager.html b/src/filemanager.html
index e8dbe799d..dd123182e 100644
--- a/src/filemanager.html
+++ b/src/filemanager.html
@@ -112,7 +112,7 @@
diff --git a/src/js/filemanager.js b/src/js/filemanager.js
index 677d0351f..0f039d21f 100644
--- a/src/js/filemanager.js
+++ b/src/js/filemanager.js
@@ -416,9 +416,18 @@ app.controller('FileManagerController', ['$scope', 'Client', function ($scope, C
init();
// setup all the dialog focus handling
- ['newDirectoryModal'].forEach(function (id) {
+ ['newDirectoryModal', 'renameEntryModal'].forEach(function (id) {
$('#' + id).on('shown.bs.modal', function () {
$(this).find("[autofocus]:first").focus();
});
});
+
+ // selects filename (without extension)
+ ['renameEntryModal'].forEach(function (id) {
+ $('#' + id).on('shown.bs.modal', function () {
+ var elem = $(this).find("[autofocus]:first");
+ var text = elem.val();
+ elem[0].setSelectionRange(0, text.indexOf('.'));
+ });
+ });
}]);