[ADD] highlighted table to double entry document

This commit is contained in:
Xavier Morel
2015-04-16 13:19:26 +02:00
parent 15c51c9845
commit 6c250deca8
3 changed files with 92 additions and 13 deletions

View File

@@ -1,9 +1,27 @@
(function () {
document.addEventListener('DOMContentLoaded', function () {
alternatives()
alternatives();
highlight();
checks_handling();
});
function highlight() {
$('.highlighter-list').each(function () {
var $this = $(this),
$target = $($this.data('target'));
$this.on('mouseout', 'li', function (e) {
$(e.currentTarget).removeClass('secondary');
$target.find('.related').removeClass('related');
}).on('mouseover', 'li', function (e) {
if (!e.currentTarget.contains(e.target)) { return; }
var $li = $(e.currentTarget);
console.log($li, $li.data('highlight'), $target.find($li.data('highlight')));
$li.addClass('secondary');
$target.find($li.data('highlight')).addClass('related');
});
});
}
/** alternatives display:
* - prepend control for each <dt>
* - radio input with link to following dd