Skip to content
Snippets Groups Projects

Resolve "Some TAs get access denied when clicking "approve""

Files

@@ -15,9 +15,30 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* Ctrl + Enter submits the form
*/
$(document).keypress(function (e) {
if (e.ctrlKey && e.keyCode === 10) {
console.log("submitting form");
$(".ctrl-enter-submit").click();
}
});
/**
* Disables the button once a TA presses submit and if all text areas are valid.
*/
$(".disable-on-submit").on('click', () => {
let allFieldsValid = true;
$("textarea").each((i,obj) => {
if (!obj.checkValidity()) {
allFieldsValid = false;
}
});
if (allFieldsValid) {
setTimeout(() => {
$(".disable-on-submit").prop('disabled', true);
}, 0);
}
});
Loading