2018-06-15 22:13:18 +00:00
|
|
|
$(document).on('turbolinks:load', function() {
|
2018-06-25 20:36:10 +00:00
|
|
|
$(document).on('keypress', ':input:not(textarea):not([type=submit])', function(e) {
|
|
|
|
if (e.keyCode == 13) {
|
|
|
|
e.preventDefault();
|
|
|
|
e.stopPropagation();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2018-06-15 22:13:18 +00:00
|
|
|
$('#submit-post').click(function(e) {
|
|
|
|
var form = $(this).parents('form.form');
|
|
|
|
|
|
|
|
if (form[0].checkValidity() === false) {
|
|
|
|
e.preventDefault();
|
|
|
|
e.stopPropagation();
|
|
|
|
}
|
|
|
|
|
|
|
|
form.addClass('was-validated');
|
|
|
|
});
|
|
|
|
});
|