Don't reload on enter in create folder dialog

Instead submit dialog and create new folder. Also have input
field focused on dialog show.
This commit is contained in:
Gina Häußge 2016-07-04 16:03:20 +02:00
parent 1991a9e2c7
commit aacb07091e
2 changed files with 10 additions and 1 deletions

View file

@ -641,6 +641,15 @@ $(function() {
});
self.addFolderDialog = $("#add_folder_dialog");
self.addFolderDialog.on("shown", function() {
$("input", self.addFolderDialog).focus();
});
$("form", self.addFolderDialog).on("submit", function(e) {
e.preventDefault();
if (self.enableAddFolder()) {
self.addFolder();
}
});
//~~ Gcode upload

View file

@ -5,7 +5,7 @@
</div>
<div class="modal-body">
<p>{{ _('Please specify the name of the folder to create.') }}</p>
<form class="form-horizontal">
<form class="form-horizontal" action="javascript:void(0)">
<div class="control-group">
<label class="control-label">{{ _('Folder name') }}</label>
<div class="controls">