Button by itself will submit forms. Button type button willn't

This commit is contained in:
Jacob Schatz 2017-01-21 23:09:08 -05:00
parent c20934869f
commit 31da4b07a6
2 changed files with 3 additions and 3 deletions

View File

@ -2,12 +2,12 @@
(function() {
this.GroupAvatar = (function() {
function GroupAvatar() {
$('.js-choose-group-avatar-button').bind("click", function() {
$('.js-choose-group-avatar-button').on("click", function() {
var form;
form = $(this).closest("form");
return form.find(".js-group-avatar-input").click();
});
$('.js-group-avatar-input').bind("change", function() {
$('.js-group-avatar-input').on("change", function() {
var filename, form;
form = $(this).closest("form");
filename = $(this).val().replace(/^.*[\\\/]/, '');

View File

@ -1,4 +1,4 @@
%button.choose-btn.btn.btn-sm.js-choose-group-avatar-button
%button.choose-btn.btn.btn-sm.js-choose-group-avatar-button{ type: 'button' }
%i.fa.fa-paperclip
%span Choose File ...