-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbehaviour.js
More file actions
29 lines (23 loc) · 884 Bytes
/
behaviour.js
File metadata and controls
29 lines (23 loc) · 884 Bytes
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
/*
* It looks like jQuery but it's Cash 💰
* https://github.com/fabiospampinato/cash#readme
*/
$(function () {
$('html').removeClass('no-js');
// Enable Streamline typography by default on local builds
if (window.location.hostname !== 'nativeformelements.com') {
$('#design-01').prop('checked', true);
$('body').addClass('design-01');
}
// Indeterminate checkbox — must be set via JS, cannot be done in HTML
const checkIndeterminate = document.getElementById('check-indeterminate');
if (checkIndeterminate) checkIndeterminate.indeterminate = true;
// Design tier toggles — apply/remove body class matching checkbox id
$('.design-option').on('change', function () {
if (this.checked) {
$('body').addClass(this.id);
} else {
$('body').removeClass(this.id);
}
});
});