Fix #3513: Missing rating error causes weird behavior in tag list on upload page.

Fix bug in the double submit prevention from #2789. Rather than
unbinding the enter key on submit, have the enter key click the submit
button instead. This avoids form submission when the submit button is disabled.
This commit is contained in:
evazion
2018-01-21 11:55:24 -06:00
parent a923a64220
commit 2833239fa0

View File

@@ -62,11 +62,12 @@
}
Danbooru.Upload.initialize_enter_on_tags = function() {
$("#upload_tag_string,#post_tag_string").on("keydown.danbooru.submit", null, "return", function(e) {
var $textarea = $("#upload_tag_string, #post_tag_string");
var $submit = $textarea.parents("form").find('input[type="submit"]');
$textarea.on("keydown.danbooru.submit", null, "return", function(e) {
if (!Danbooru.autocompleting) {
$("#form").trigger("submit");
$("#quick-edit-form").trigger("submit");
$("#upload_tag_string,#post_tag_string").off(".submit");
$submit.click();
}
e.preventDefault();