summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Schatz <jschatz1@gmail.com>2017-01-21 23:09:08 -0500
committerJacob Schatz <jschatz1@gmail.com>2017-01-21 23:09:08 -0500
commit31da4b07a6688b8037a3287a94fc7633bf2c74a0 (patch)
tree4559ab3d06c4a4e4b66d6d9ff48667e9ec343e11
parentc20934869f7dc8cfbdbafb6ecb7b1305452c9e8a (diff)
downloadgitlab-ce-31da4b07a6688b8037a3287a94fc7633bf2c74a0.tar.gz
Button by itself will submit forms. Button type button willn't
-rw-r--r--app/assets/javascripts/group_avatar.js4
-rw-r--r--app/views/shared/_choose_group_avatar_button.html.haml2
2 files changed, 3 insertions, 3 deletions
diff --git a/app/assets/javascripts/group_avatar.js b/app/assets/javascripts/group_avatar.js
index 5247b2a08f7..10dfd05fe3c 100644
--- a/app/assets/javascripts/group_avatar.js
+++ b/app/assets/javascripts/group_avatar.js
@@ -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(/^.*[\\\/]/, '');
diff --git a/app/views/shared/_choose_group_avatar_button.html.haml b/app/views/shared/_choose_group_avatar_button.html.haml
index ee043910548..94295970acf 100644
--- a/app/views/shared/_choose_group_avatar_button.html.haml
+++ b/app/views/shared/_choose_group_avatar_button.html.haml
@@ -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 ...
&nbsp;