Button by itself will submit forms. Button type button willn't
This commit is contained in:
parent
c20934869f
commit
31da4b07a6
|
@ -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(/^.*[\\\/]/, '');
|
||||
|
|
|
@ -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 ...
|
||||
|
||||
|
|
Loading…
Reference in New Issue