Commit b6c04b15 authored by mcramer's avatar mcramer
Browse files

Fixed: ajax request is submitted twice on pressing enter (theme default and default-v2)

parent e75e35b0
......@@ -48,6 +48,7 @@
jQuery(document).bind("change", function(event) {
if (jQuery(".panel #Filter").length > 0 && event.target.localName == 'select') {
event.preventDefault();
jQuery(".panel #Filter").trigger('click');
}
});
......@@ -55,10 +56,12 @@
jQuery(document).bind("keypress", function(event) {
//Use jQuery submit with keypress Enter in panel filterbar
if (event.which == '13' && jQuery(".panel #Filter").length > 0) {
event.preventDefault();
jQuery(".panel #Filter").trigger('click');
}
//Use jQuery submit with keypress Enter in forms
if (event.which == '13' && jQuery(".pnl_formsarea button.positive").length > 0 && event.target.localName != 'textarea') {
event.preventDefault();
jQuery(".pnl_formsarea button.positive:first").trigger('click');
}
});
......
......@@ -98,6 +98,7 @@
jQuery(document).bind("change", function(event) {
if (jQuery(".panel #Filter").length > 0 && event.target.localName == 'select') {
event.preventDefault();
jQuery(".panel #Filter").trigger('click');
}
});
......@@ -105,10 +106,12 @@
jQuery(document).bind("keypress", function(event) {
//Use jQuery submit with keypress Enter in panel filterbar
if (event.which == '13' && jQuery(".panel #Filter").length > 0) {
event.preventDefault();
jQuery(".panel #Filter").trigger('click');
}
//Use jQuery submit with keypress Enter in forms
if (event.which == '13' && jQuery(".pnl_formsarea button.positive").length > 0 && event.target.localName != 'textarea') {
event.preventDefault();
jQuery(".pnl_formsarea button.positive:first").trigger('click');
}
});
......
Supports Markdown
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