Skip to content

Commit

Permalink
Remove redundant client-side render
Browse files Browse the repository at this point in the history
Incidentally resolves a JavaScript error introduced in #3138 affecting
pages without the proposal form:

    Uncaught TypeError: text is undefined
      at word_count (app/assets/javascripts/osem.js:134)
  • Loading branch information
AndrewKvalheim committed May 31, 2023
1 parent 63a83f1 commit 99c854f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/assets/javascripts/osem.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,17 +145,15 @@ function word_count(text, divId, maxcount) {
/* Wait for the DOM to be ready before attaching events to the elements */
$( document ).ready(function() {
/* Set the minimum and maximum proposal abstract word length */
function updateEventTypeRequirements() {
$("#event_event_type_id").change(function () {
var $selected = $("#event_event_type_id option:selected")
var max = $selected.data("max-words");
var min = $selected.data("min-words");

$("#abstract-maximum-word-count").text(max);
$("#abstract-minimum-word-count").text(min);
word_count($('#event_abstract').get(0), 'abstract-count', max);
}
$("#event_event_type_id").change(updateEventTypeRequirements);
updateEventTypeRequirements();
});

/* Count the proposal abstract length */
$("#event_abstract").on('input', function() {
Expand Down

0 comments on commit 99c854f

Please sign in to comment.