forked from adamlaska/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagenda_personalize.js
More file actions
41 lines (37 loc) · 1.15 KB
/
agenda_personalize.js
File metadata and controls
41 lines (37 loc) · 1.15 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
34
35
36
37
38
39
40
41
// Copyright The IETF Trust 2021, All Rights Reserved
/**
* Agenda personalization JS methods
*
* Requires agenda_timezone.js and timezone.js be included.
*/
'use strict';
/**
* Update the checkbox state to match the filter parameters
*/
function updateAgendaCheckboxes(filter_params) {
var selection_inputs = document.getElementsByName('selected-sessions');
selection_inputs.forEach((inp) => {
const item_keywords = inp.dataset.filterKeywords.toLowerCase()
.split(',');
if (
agenda_filter.keyword_match(item_keywords, filter_params.show) &&
!agenda_filter.keyword_match(item_keywords, filter_params.hide)
) {
inp.checked = true;
} else {
inp.checked = false;
}
});
}
window.handleFilterParamUpdate = function (filter_params) {
updateAgendaCheckboxes(filter_params);
};
window.handleTableClick = function (event) {
if (event.target.name === 'selected-sessions') {
// hide the tooltip after clicking on a checkbox
const jqElt = jQuery(event.target);
if (jqElt.tooltip) {
jqElt.tooltip('hide');
}
}
};