diff options
author | Stan Hu <stanhu@gmail.com> | 2017-01-22 05:40:38 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-01-21 22:05:36 -0800 |
commit | 7f58faabad5d736f3c6eea48c9960e88ef0c727a (patch) | |
tree | 019039e2ce473aaa8fb43f2ce93578fced72f1de | |
parent | 09404b07ac73f0312765510642a3a3d3c1671950 (diff) | |
download | gitlab-ce-7f58faabad5d736f3c6eea48c9960e88ef0c727a.tar.gz |
Merge branch 'fix-upload-group-avatar' into 'master'
Button by itself will submit forms. Button type button willn't
Closes #26999
See merge request !8694
-rw-r--r-- | app/assets/javascripts/group_avatar.js | 4 | ||||
-rw-r--r-- | app/views/shared/_choose_group_avatar_button.html.haml | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/app/assets/javascripts/group_avatar.js b/app/assets/javascripts/group_avatar.js index 17a76168a79..df7390933b2 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 ... |