| Index: chrome/browser/resources/filebrowse.html
|
| ===================================================================
|
| --- chrome/browser/resources/filebrowse.html (revision 45485)
|
| +++ chrome/browser/resources/filebrowse.html (working copy)
|
| @@ -854,7 +854,6 @@
|
| input.id = 'newfoldername';
|
| input.onblur = blurcallback;
|
| input.onkeypress = keypresscallback;
|
| - input.focus();
|
|
|
| input.value = initialName;
|
| link.appendChild(input);
|
| @@ -873,7 +872,19 @@
|
| currentPath += '/';
|
| currentPath += filename;
|
| var existingfolder = $(currentPath);
|
| - if (existingfolder || filename == '') {
|
| + var counter = 1;
|
| + while (existingfolder) {
|
| + var testfilepath = currentPath;
|
| + testfilepath = testfilepath + counter;
|
| + existingfolder = $(testfilepath);
|
| + if (!existingfolder) {
|
| + currentPath = testfilepath;
|
| + filename = filename + counter;
|
| + break;
|
| + }
|
| + counter++;
|
| + }
|
| + if (filename == '') {
|
| return false;
|
| }
|
| var parent = element.parentNode;
|
| @@ -1081,6 +1092,8 @@
|
| partial(createFolderTyping, id));
|
| list.appendChild(element);
|
| element.scrollIntoView();
|
| + var inputelement = $('newfoldername');
|
| + inputelement.focus();
|
| }
|
|
|
| ///////////////////////////////////////////////////////////////////////////////
|
|
|