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,17 +48,20 @@ ...@@ -48,17 +48,20 @@
jQuery(document).bind("change", function(event) { jQuery(document).bind("change", function(event) {
if (jQuery(".panel #Filter").length > 0 && event.target.localName == 'select') { 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) { jQuery(document).bind("keypress", function(event) {
//Use jQuery submit with keypress Enter in panel filterbar //Use jQuery submit with keypress Enter in panel filterbar
if (event.which == '13' && jQuery(".panel #Filter").length > 0) { if (event.which == '13' && jQuery(".panel #Filter").length > 0) {
event.preventDefault();
jQuery(".panel #Filter").trigger('click'); jQuery(".panel #Filter").trigger('click');
} }
//Use jQuery submit with keypress Enter in forms //Use jQuery submit with keypress Enter in forms
if (event.which == '13' && jQuery(".pnl_formsarea button.positive").length > 0 && event.target.localName != 'textarea') { 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'); jQuery(".pnl_formsarea button.positive:first").trigger('click');
} }
}); });
...@@ -107,4 +110,4 @@ ...@@ -107,4 +110,4 @@
</footer><!-- end: footer --> </footer><!-- end: footer -->
</div> </div>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -98,6 +98,7 @@ ...@@ -98,6 +98,7 @@
jQuery(document).bind("change", function(event) { jQuery(document).bind("change", function(event) {
if (jQuery(".panel #Filter").length > 0 && event.target.localName == 'select') { if (jQuery(".panel #Filter").length > 0 && event.target.localName == 'select') {
event.preventDefault();
jQuery(".panel #Filter").trigger('click'); jQuery(".panel #Filter").trigger('click');
} }
}); });
...@@ -105,10 +106,12 @@ ...@@ -105,10 +106,12 @@
jQuery(document).bind("keypress", function(event) { jQuery(document).bind("keypress", function(event) {
//Use jQuery submit with keypress Enter in panel filterbar //Use jQuery submit with keypress Enter in panel filterbar
if (event.which == '13' && jQuery(".panel #Filter").length > 0) { if (event.which == '13' && jQuery(".panel #Filter").length > 0) {
event.preventDefault();
jQuery(".panel #Filter").trigger('click'); jQuery(".panel #Filter").trigger('click');
} }
//Use jQuery submit with keypress Enter in forms //Use jQuery submit with keypress Enter in forms
if (event.which == '13' && jQuery(".pnl_formsarea button.positive").length > 0 && event.target.localName != 'textarea') { 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'); jQuery(".pnl_formsarea button.positive:first").trigger('click');
} }
}); });
...@@ -171,4 +174,4 @@ ...@@ -171,4 +174,4 @@
</div> </div>
</div> </div>
</body> </body>
</html> </html>
\ No newline at end of file
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