-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinvention_disclosure.js
More file actions
36 lines (28 loc) · 1.22 KB
/
invention_disclosure.js
File metadata and controls
36 lines (28 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
var $ = require('jquery');
window.jQuery = $;
const bind_to_access_level = () =>
$('body').on('click', 'div.author', function(e) {
if ($('div.author #submission_access_level_restricted').prop('checked')) {
$('div#invention').removeClass('d-none');
$('#submission_invention_disclosures_attributes_0_id_number').focus();
} else {
$('input#submission_invention_disclosures_attributes_0_id_number').attr('value', '');
$('div#invention').addClass('d-none');
e.preventDefault;
}
if ($('div.author #submission_access_level_restricted_to_institution').prop('checked') ||
$('div.author #submission_access_level_restricted_liberal_arts').prop('checked')) {
$('div#restricted_note').removeClass('d-none');
return $('#submission_restricted_notes').focus();
} else {
$('div#restricted_note').addClass('d-none');
return e.preventDefault;
}
})
;
$(document).ready(bind_to_access_level);