aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/app/assets/javascripts/activestorage.js
diff options
context:
space:
mode:
authorTasos Maschalidis <tas.o.s@hotmail.com>2018-11-24 21:54:05 +0200
committerGeorge Claghorn <george.claghorn@gmail.com>2018-11-24 14:54:05 -0500
commitd6fcc419fe4f99d3f9414d39d081bd6355842018 (patch)
treed2de1b95ad5ef5548bfc37077eb1173dc20167de /activestorage/app/assets/javascripts/activestorage.js
parentf3a79e6aa5da48ac3e4d2fbedf44cb7b58f2a379 (diff)
downloadrails-d6fcc419fe4f99d3f9414d39d081bd6355842018.tar.gz
rails-d6fcc419fe4f99d3f9414d39d081bd6355842018.tar.bz2
rails-d6fcc419fe4f99d3f9414d39d081bd6355842018.zip
ASt direct uploads: account for <button type="submit"> elements
Diffstat (limited to 'activestorage/app/assets/javascripts/activestorage.js')
-rw-r--r--activestorage/app/assets/javascripts/activestorage.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/activestorage/app/assets/javascripts/activestorage.js b/activestorage/app/assets/javascripts/activestorage.js
index 375eb6b533..b71e251a11 100644
--- a/activestorage/app/assets/javascripts/activestorage.js
+++ b/activestorage/app/assets/javascripts/activestorage.js
@@ -867,7 +867,7 @@
}
function didClick(event) {
var target = event.target;
- if (target.tagName == "INPUT" && target.type == "submit" && target.form) {
+ if ((target.tagName == "INPUT" || target.tagName == "BUTTON") && target.type == "submit" && target.form) {
submitButtonsByForm.set(target.form, target);
}
}
@@ -902,7 +902,7 @@
}
}
function submitForm(form) {
- var button = submitButtonsByForm.get(form) || findElement(form, "input[type=submit]");
+ var button = submitButtonsByForm.get(form) || findElement(form, "input[type=submit], button[type=submit]");
if (button) {
var _button = button, disabled = _button.disabled;
button.disabled = false;