entries stay hightlighted if doc is currently playing

This commit is contained in:
Bachir Soussi Chiadmi
2018-03-28 13:24:09 +02:00
parent 69b64b7881
commit 2969c2544d
2 changed files with 36 additions and 20 deletions
@@ -183,7 +183,6 @@
// _scrambler_CR.position = {x:_canvas.width+200, y:_canvas.height/2}; // _scrambler_CR.position = {x:_canvas.width+200, y:_canvas.height/2};
}; };
// _ _ _ // _ _ _
// | \| |___ __| |___ ___ // | \| |___ __| |___ ___
// | .` / _ \/ _` / -_|_-< // | .` / _ \/ _` / -_|_-<
@@ -404,6 +403,7 @@
Node.prototype.open = function(){ Node.prototype.open = function(){
this.opened = true; this.opened = true;
_node_opened_id = this.id;
}; };
Node.prototype.close = function(){ Node.prototype.close = function(){
this.opened = false; this.opened = false;
@@ -667,12 +667,20 @@
}; };
function highlightEntries(){ function highlightEntries(){
_$entrees_block_termlinks.removeClass('highlighted'); _$entrees_block_termlinks.removeClass('highlighted');
var id = -1;
if(_node_hover_id != -1){
id = _node_hover_id;
}else if(_node_opened_id != -1){
id = _node_opened_id;
}
var entree; var entree;
for (var i = 0; i < _nodes[_node_hover_id].entrees.length; i++) { if(id != -1){
entree = _nodes[_node_hover_id].entrees[i]; for (var i = 0; i < _nodes[id].entrees.length; i++) {
_$entrees_block_termlinks.filter(function(){ entree = _nodes[id].entrees[i];
return $(this).attr('tid') == entree; _$entrees_block_termlinks.filter(function(){
}).addClass('highlighted'); return $(this).attr('tid') == entree;
}).addClass('highlighted');
}
} }
}; };
@@ -959,12 +967,12 @@
if(_node_hover_id != -1){ if(_node_hover_id != -1){
_canvas.style.cursor = 'pointer'; _canvas.style.cursor = 'pointer';
highlightEntries();
// _node_pop_up.visible = true;
}else{ }else{
_canvas.style.cursor = 'auto'; _canvas.style.cursor = 'auto';
_$entrees_block_termlinks.removeClass('highlighted'); }
// _node_pop_up.visible = false; // check for highlighted entries
if(_node_hover_id != -1 || _node_opened_id != -1){
highlightEntries();
} }
}; };
@@ -183,7 +183,6 @@
// _scrambler_CR.position = {x:_canvas.width+200, y:_canvas.height/2}; // _scrambler_CR.position = {x:_canvas.width+200, y:_canvas.height/2};
}; };
// _ _ _ // _ _ _
// | \| |___ __| |___ ___ // | \| |___ __| |___ ___
// | .` / _ \/ _` / -_|_-< // | .` / _ \/ _` / -_|_-<
@@ -404,6 +403,7 @@
Node.prototype.open = function(){ Node.prototype.open = function(){
this.opened = true; this.opened = true;
_node_opened_id = this.id;
}; };
Node.prototype.close = function(){ Node.prototype.close = function(){
this.opened = false; this.opened = false;
@@ -667,12 +667,20 @@
}; };
function highlightEntries(){ function highlightEntries(){
_$entrees_block_termlinks.removeClass('highlighted'); _$entrees_block_termlinks.removeClass('highlighted');
var id = -1;
if(_node_hover_id != -1){
id = _node_hover_id;
}else if(_node_opened_id != -1){
id = _node_opened_id;
}
var entree; var entree;
for (var i = 0; i < _nodes[_node_hover_id].entrees.length; i++) { if(id != -1){
entree = _nodes[_node_hover_id].entrees[i]; for (var i = 0; i < _nodes[id].entrees.length; i++) {
_$entrees_block_termlinks.filter(function(){ entree = _nodes[id].entrees[i];
return $(this).attr('tid') == entree; _$entrees_block_termlinks.filter(function(){
}).addClass('highlighted'); return $(this).attr('tid') == entree;
}).addClass('highlighted');
}
} }
}; };
@@ -959,12 +967,12 @@
if(_node_hover_id != -1){ if(_node_hover_id != -1){
_canvas.style.cursor = 'pointer'; _canvas.style.cursor = 'pointer';
highlightEntries();
// _node_pop_up.visible = true;
}else{ }else{
_canvas.style.cursor = 'auto'; _canvas.style.cursor = 'auto';
_$entrees_block_termlinks.removeClass('highlighted'); }
// _node_pop_up.visible = false; // check for highlighted entries
if(_node_hover_id != -1 || _node_opened_id != -1){
highlightEntries();
} }
}; };