tag counter: fix clicking related tags not updating counter.

This commit is contained in:
evazion
2020-08-03 23:18:11 -05:00
parent 157cb96551
commit 5aa7019cfe

View File

@@ -1,6 +1,5 @@
import Uploads from './uploads.js.erb';
import Utility from './utility';
import Post from './posts.js.erb';
let RelatedTag = {};
@@ -121,7 +120,8 @@ RelatedTag.toggle_tag = function(e) {
setTimeout(function () { $field.prop('selectionStart', $field.val().length);}, 100);
e.preventDefault();
Post.update_tag_count({ target: $field });
// Artificially trigger input event so the tag counter updates.
$field.trigger("input");
}
RelatedTag.show = function(e) {