Merge pull request #2973 from AndrewKvalheim/word-count-events

Remove excessive word counts
This commit is contained in:
Henne Vogelsang 2022-03-29 15:19:42 +02:00 committed by GitHub
commit 6601cb2b1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -133,7 +133,7 @@ function get_color() {
function word_count(text, divId, maxcount) {
var area = document.getElementById(text.id)
Countable.live(area, function(counter) {
Countable.once(area, function(counter) {
$('#' + divId).text(counter.words);
if (counter.words > maxcount)
$('#' + divId).css('color', 'red');
@ -157,7 +157,7 @@ $( document ).ready(function() {
.trigger('change');
/* Count the proposal abstract length */
$("#event_abstract").bind('change keyup paste input', function() {
$("#event_abstract").on('input', function() {
var $selected = $("#event_event_type_id option:selected")
var max = $selected.data("max-words");
word_count(this, 'abstract-count', max);