-
Notifications
You must be signed in to change notification settings - Fork 56
/
resources.js
40 lines (34 loc) · 1.09 KB
/
resources.js
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
34
35
36
37
38
39
40
$(document).ready(function(){
// Expand all
$( '.floe-resources-show' ).click(function() {
$( '.floe-resources-toggle' )
.attr('aria-expanded', true)
.closest('.floe-resources-category')
.find('div')
.toggleClass('floe-resources-content-show', true);
});
// // Hide all
$( '.floe-resources-hide' ).click(function() {
$( '.floe-resources-toggle' )
.attr('aria-expanded', false)
.closest('.floe-resources-category')
.find('div')
.toggleClass('floe-resources-content-show', false);
});
// Toggle each category to show content
$('.floe-resources-toggle').click(function(evt) {
var target = $(evt.delegateTarget);
var state = target.attr('aria-expanded') === 'true' ? true : false;
target.attr('aria-expanded', !state)
.closest('.floe-resources-category')
.find('div')
.toggleClass('floe-resources-content-show', !state);
evt.preventDefault();
});
});
// if (!state) {
// $(.arrow).text('\u25B6');
// else {
// $(.arrow).text('\u25BC');
// }
// }