Skip to content

Commit

Permalink
Make textarea readonly when status is submitted
Browse files Browse the repository at this point in the history
  • Loading branch information
rstorey committed Mar 21, 2019
1 parent 7d3097c commit e31668a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion concordia/static/js/contribute.js
Expand Up @@ -179,11 +179,16 @@ $transcriptionEditor
data.transcriptionStatus != 'not_started' &&
data.transcriptionStatus != 'submitted')
) {
// If the status is completed OR if the user doesn't have the reservation

This comment has been minimized.

Copy link
@acdha

acdha Mar 21, 2019

Member

This comment makes me wonder whether the block above should just be “!reservation OR status != completed” instead of enumerating all of the other statuses now that it's just one

lockControls($transcriptionEditor);
} else {
// Either in transcribe or review mode OR the user has the reservation
var $textarea = $transcriptionEditor.find('textarea');

if ($nothingToTranscribeCheckbox.prop('checked')) {
if (
$nothingToTranscribeCheckbox.prop('checked') ||
data.transcriptionStatus == 'submitted'
) {
$textarea.attr('readonly', 'readonly');
} else {
$textarea.removeAttr('readonly');
Expand All @@ -197,6 +202,7 @@ $transcriptionEditor
$nothingToTranscribeCheckbox.prop('checked', true);
}
} else {
// Unsaved changes are in the textarea and we're in transcribe mode
$submitButton.attr('disabled', 'disabled');

if (
Expand All @@ -215,6 +221,7 @@ $transcriptionEditor
(data.transcriptionStatus == 'in_progress' ||
data.transcriptionStatus == 'not_started')
) {
// If we're in transcribe mode and we don't have the reservation
$('.tx-status-display')
.children()
.attr('hidden', 'hidden')
Expand Down

0 comments on commit e31668a

Please sign in to comment.