pathfinder/src/highlighting.js
//Highlight node that mouse is over

Highlight node that mouse is over
Highlight node that mouse is over
function highlight() {
    nodeID = getid(this);
    for(i=0; i<y; i++){
        for(j=0; j<x; j++){
            if (grid[i][j].id === nodeID){
                if(grid[i][j].start == false && grid[i][j].end == false && grid[i][j].wall == false) {           
                    document.getElementById(nodeID).style = 'background-color: #ffdf00';
                }
            }
        }
    }
}
function highlight ( ) { nodeID = getid ( this ) ; for ( i = 0 ; i < y ; i ++ ) { for ( j = 0 ; j < x ; j ++ ) { if ( grid [ i ] [ j ] . id === nodeID ) { if ( grid [ i ] [ j ] . start == false && grid [ i ] [ j ] . end == false && grid [ i ] [ j ] . wall == false ) { document . getElementById ( nodeID ) . style = 'background-color: #ffdf00' ; } } } } }
Highlight node that mouse is over
Highlight node that mouse is over
//node won't highlight if it has been set as start/end/wall node
