Skip to content

Commit

Permalink
Merge pull request #529 from CityOfNewYork/develop
Browse files Browse the repository at this point in the history
OpenRecords v3.4.6
  • Loading branch information
johnyu95 authored Jul 7, 2020
2 parents 247a8bc + 4298bd5 commit 799c35c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/static/js/request/view-request-responses.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,10 @@ $(function () {
"<span class=\"glyphicon glyphicon-exclamation-sign\"></span>&nbsp;" +
"<strong>Error, note content is required.</strong> Please type in a message.");

characterCounter("#character-counter-note-" + response_id, 5000, tinyMCE.get("note-" + response_id).getContent({format: 'text'}).trim().length);
// Check the ID to make sure the tinymce field exists before setting the character counter
if ($('#note-' + response_id).length) {
characterCounter('#character-counter-note-' + response_id, 5000, tinyMCE.get('note-' + response_id).getContent({format: 'text'}).trim().length);
}

break;

Expand Down Expand Up @@ -574,7 +577,10 @@ $(function () {
"<span class=\"glyphicon glyphicon-exclamation-sign\"></span>&nbsp;" +
"<strong>Error, Offline Instructions must be at least 20 characters.</strong>");

characterCounter("#character-counter-instruction-" + response_id, 500, tinyMCE.get("instruction-" + response_id).getContent({format: 'text'}).trim().length, 20);
// Check the ID to make sure the tinymce field exists before setting the character counter
if ($('#instruction-' + response_id).length) {
characterCounter('#character-counter-instruction-' + response_id, 500, tinyMCE.get('instruction-' + response_id).getContent({format: 'text'}).trim().length, 20);
}

break;

Expand Down

0 comments on commit 799c35c

Please sign in to comment.