Commit e5d3f381 authored by Matija Obreza's avatar Matija Obreza

Prevent browser form-submit on Enter key

parent 71dc226a
......@@ -64,7 +64,7 @@
</div>
<div class="large-4 columns">
<a href="#" data-close class="button info closeModal">Cancel</a>
<a href="#" class="button success">Rename</a>
<button type="submit" class="button success">Rename</button>
</div>
</div>
</form>
......@@ -87,7 +87,7 @@
</div>
<div class="large-4 columns">
<a href="#" data-close class="button info closeModal">Cancel</a>
<a href="#" class="button success">Create</a>
<button type="submit" class="button success">Create</button>
</div>
</div>
</form>
......@@ -124,7 +124,7 @@
</div>
<div class="large-4 columns">
<a href="#" data-close class="button info closeModal">Cancel</a>
<a href="#" class="button success">Load tree</a>
<button type="submit" class="button success">Load tree</button>
</div>
</div>
</form>
......
......@@ -44,17 +44,22 @@ $('document').ready(function() {
element.focus();
});
$('#RenameNodeForm .success').click((e) => {
$('form#RenameNodeForm').submit((e) => {
// console.log('Submit renamenode form');
e.preventDefault();
rename_node();
return false;
});
$('#CreateNodeForm .success').click((e) => {
$('form#CreateNodeForm').submit((e) => {
// console.log('Submit createnode form');
e.preventDefault();
create_node();
return false;
});
$('#ImportTreeModal .success').click((e) => {
$('#ImportTreeModal form').submit((e) => {
// console.log('Submit importtree form');
e.preventDefault();
$('#ImportTreeModal .errorMessage')[0].innerHTML = '';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment