🚧 dinglehopper: Use a Bootstrap tooltip for the segment id
parent
a320d5fd8f
commit
257e4986cc
@ -1,19 +1,15 @@
|
|||||||
function find_diff_class(classes) {
|
function find_diff_class(classes) {
|
||||||
return classes.split(/\s+/).find(x => x.match(/.diff\d.*/));
|
return $('.' + classes.split(/\s+/).find(x => x.match(/.diff\d.*/)));
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('.diff').mouseover(function() {
|
/* Enable Bootstrap tooltips */
|
||||||
let c = find_diff_class($(this).attr('class'));
|
$('[data-toggle="tooltip"]').tooltip();
|
||||||
$('.' + c).addClass('diff-highlight');
|
|
||||||
|
|
||||||
segment_id = $(this).attr('data-segment-id');
|
$('.diff').mouseover(function() {
|
||||||
$(this).closest('div').find('.status-box').text(segment_id);
|
find_diff_class($(this).attr('class')).addClass('diff-highlight');
|
||||||
});
|
});
|
||||||
$('.diff').mouseout(function() {
|
$('.diff').mouseout(function() {
|
||||||
let c = find_diff_class($(this).attr('class'));
|
find_diff_class($(this).attr('class')).removeClass('diff-highlight');
|
||||||
$('.' + c).removeClass('diff-highlight');
|
|
||||||
|
|
||||||
$(this).closest('div').find('.status-box').text('');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue