fix is_active student flag and apply it in all pages
This commit is contained in:
@@ -81,7 +81,9 @@
|
||||
btn.type = 'button';
|
||||
btn.className = 'btn btn-link btn-sm ps-0';
|
||||
btn.textContent = 'Apply';
|
||||
btn.disabled = !!(textarea.disabled || textarea.readOnly);
|
||||
btn.addEventListener('click', () => {
|
||||
if (textarea.disabled || textarea.readOnly) return;
|
||||
textarea.value = applyMatches(textarea.value, [match]);
|
||||
resize(textarea);
|
||||
textarea.dispatchEvent(new Event('input', { bubbles: true }));
|
||||
@@ -97,6 +99,7 @@
|
||||
|
||||
const proofreadField = async (textarea) => {
|
||||
if (!textarea) return { ok: false };
|
||||
if (textarea.disabled || textarea.readOnly) return { ok: true, skipped: true };
|
||||
const targetId = textarea.id || textarea.name || '';
|
||||
|
||||
const text = textarea.value || '';
|
||||
@@ -159,7 +162,8 @@
|
||||
const proofreadAll = async () => {
|
||||
const btn = document.getElementById('proofreadAllBtn');
|
||||
const summary = document.getElementById('proofreadAllStatus');
|
||||
const fields = Array.from(document.querySelectorAll('textarea.review-field'));
|
||||
const fields = Array.from(document.querySelectorAll('textarea.review-field:not(:disabled)'))
|
||||
.filter((field) => !field.readOnly);
|
||||
if (!fields.length) return;
|
||||
|
||||
if (btn) btn.disabled = true;
|
||||
|
||||
Reference in New Issue
Block a user