summaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorFlorian Schunk <florian.schunk@rwth-aachen.de>2018-12-22 12:06:56 +0100
committerFlorian Schunk <florian.schunk@rwth-aachen.de>2019-01-09 11:28:51 +0100
commitff1e0e2302b2cfe0db888dabae7ad2a876425d1f (patch)
tree5351076e59afdfc24d81ea2062bf67fccfe95896 /core/js
parentb61df4e29056437a3f59c48e9d0e404a3fa05359 (diff)
downloadnextcloud-server-ff1e0e2302b2cfe0db888dabae7ad2a876425d1f.tar.gz
nextcloud-server-ff1e0e2302b2cfe0db888dabae7ad2a876425d1f.zip
reset name of new folder and prevent the form from being submitted twice
Signed-off-by: Florian Schunk <florian.schunk@rwth-aachen.de>
Diffstat (limited to 'core/js')
-rw-r--r--core/js/oc-dialogs.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js
index bf34ac1e556..bf87c8b6423 100644
--- a/core/js/oc-dialogs.js
+++ b/core/js/oc-dialogs.js
@@ -262,6 +262,8 @@ var OCdialogs = {
OC.registerMenu(newButton,self.$filePicker.find('.menu'),function () {
$input.focus();
self.$filePicker.ocdialog('setEnterCallback', function() {
+ event.stopImmediatePropagation();
+ event.preventDefault();
self.$form.submit();
});
var newName = $input.val();
@@ -275,7 +277,7 @@ var OCdialogs = {
var $input = $form.find('input[type=\'text\']');
var $submit = $form.find('input[type=\'submit\']');
$submit.on('click',function(event) {
- event.stopPropagation();
+ event.stopImmediatePropagation();
event.preventDefault();
$form.submit();
});
@@ -314,10 +316,13 @@ var OCdialogs = {
OC.hideMenus();
self.$filePicker.ocdialog('unsetEnterCallback');
self.$filePicker.click();
+ $input.val(newText);
}
});
$input.keypress(function(event) {
if (event.keyCode == 13 || event.which == 13) {
+ event.stopImmediatePropagation();
+ event.preventDefault();
$form.submit();
}
});