Fix file rename focus and initial selection
This commit is contained in:
@@ -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('.'));
|
||||
});
|
||||
});
|
||||
}]);
|
||||
|
||||
Reference in New Issue
Block a user