Commit b6c04b15 authored by mcramer's avatar mcramer

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

parent e75e35b0
......@@ -48,17 +48,20 @@
jQuery(document).bind("change", function(event) {
if (jQuery(".panel #Filter").length > 0 && event.target.localName == 'select') {
jQuery(".panel #Filter").trigger('click');
event.preventDefault();
jQuery(".panel #Filter").trigger('click');
}
});
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');
}
});
......@@ -107,4 +110,4 @@
</footer><!-- end: footer -->
</div>
</body>
</html>
\ No newline at end of file
</html>
......@@ -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');
}
});
......@@ -171,4 +174,4 @@
</div>
</div>
</body>
</html>
\ No newline at end of file
</html>
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