summaryrefslogtreecommitdiffstats
path: root/apps/files/js/filelist.js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-06-23 16:35:11 +0200
committerVincent Petry <pvince81@owncloud.com>2014-06-23 16:35:11 +0200
commit7d4747ea1692f42b9ae007cf5da654a95c610ec3 (patch)
treebd580d068fd479bb7ef96d3b107eefd8653e796e /apps/files/js/filelist.js
parent8c8209828126a55b9bf775e00cbc14d7ef7db5ae (diff)
downloadnextcloud-server-7d4747ea1692f42b9ae007cf5da654a95c610ec3.tar.gz
nextcloud-server-7d4747ea1692f42b9ae007cf5da654a95c610ec3.zip
Fix blurring of invalid file name on rename
When renaming to an existing file name, blurring the field should not remove it. This fix keeps the field until escape is pressed instead of replacing it with a broken empty space.
Diffstat (limited to 'apps/files/js/filelist.js')
-rw-r--r--apps/files/js/filelist.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index fb97b2f4595..fc08d9b54fc 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -1195,9 +1195,20 @@
return true;
};
+ function restore() {
+ input.tipsy('hide');
+ tr.data('renaming',false);
+ form.remove();
+ td.children('a.name').show();
+ }
+
form.submit(function(event) {
event.stopPropagation();
event.preventDefault();
+ if (input.hasClass('error')) {
+ return;
+ }
+
try {
var newName = input.val();
input.tipsy('hide');
@@ -1267,10 +1278,7 @@
input.addClass('error');
}
if (event.keyCode === 27) {
- input.tipsy('hide');
- tr.data('renaming',false);
- form.remove();
- td.children('a.name').show();
+ restore();
}
});
input.click(function(event) {