Skip to content

Commit

Permalink
Merge pull request #2973 from AndrewKvalheim/word-count-events
Browse files Browse the repository at this point in the history
Remove excessive word counts
  • Loading branch information
hennevogel authored Mar 29, 2022
2 parents d471d9e + 9de2cba commit 6601cb2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/assets/javascripts/osem.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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);
Expand Down

0 comments on commit 6601cb2

Please sign in to comment.