function clear_up(the_last_one_id){
    var last_idx = 0;
    for(var l = OPEN_NODES_BY_ORDER.length - 1; l >= 0; l--){
        if ( OPEN_NODES_BY_ORDER[l].id == the_last_one_id ){
            last_idx = l;
            break;
        }
    }
    if ( last_idx > 0 ){
        OPEN_NODES_REFORMATTED_NAMES.splice(0, last_idx);
        var removed_ones = OPEN_NODES_BY_ORDER.splice(0, last_idx);
        for (var node of removed_ones) {
            node.instance.remove_element();
        }
        update_ui_open_nodes_list();
        if ( OPEN_NODES_BY_ORDER.length == 1){ // there is only one remained node!
            // make sure it's playable (Note: currently only content nodes clear up)
            OPEN_NODES_BY_ORDER[0].instance.step_back();
        }
    } else {
        throw new Error(`The annotated node (${the_last_one_id}) is not open or is the first one. We can only clean view from a node backward.`);
    }
}
// Clears view by removing all the appended nodes before the one with resource-uid passed as `the_last_one_id`.
Clears view by removing all the appended nodes before the one with resource-uid passed as `the_last_one_id`.
Clears view by removing all the appended nodes before the one with resource - uid passed as ` the_last_one_id ` .
function clear_up(the_last_one_id){
    var last_idx = 0;
    for(var l = OPEN_NODES_BY_ORDER.length - 1; l >= 0; l--){
        if ( OPEN_NODES_BY_ORDER[l].id == the_last_one_id ){
            last_idx = l;
            break;
        }
    }
    if ( last_idx > 0 ){
        OPEN_NODES_REFORMATTED_NAMES.splice(0, last_idx);
        var removed_ones = OPEN_NODES_BY_ORDER.splice(0, last_idx);
        for (var node of removed_ones) {
            node.instance.remove_element();
        }
        update_ui_open_nodes_list();
        if ( OPEN_NODES_BY_ORDER.length == 1){ 
            OPEN_NODES_BY_ORDER[0].instance.step_back();
        }
    } else {
        throw new Error(`The annotated node (${the_last_one_id}) is not open or is the first one. We can only clean view from a node backward.`);
    }
}
function clear_up ( the_last_one_id ) { var last_idx = 0 ; for ( var l = OPEN_NODES_BY_ORDER . length - 1 ; l >= 0 ; l -- ) { if ( OPEN_NODES_BY_ORDER [ l ] . id == the_last_one_id ) { last_idx = l ; break ; } } if ( last_idx > 0 ) { OPEN_NODES_REFORMATTED_NAMES . splice ( 0 , last_idx ) ; var removed_ones = OPEN_NODES_BY_ORDER . splice ( 0 , last_idx ) ; for ( var node of removed_ones ) { node . instance . remove_element ( ) ; } update_ui_open_nodes_list ( ) ; if ( OPEN_NODES_BY_ORDER . length == 1 ) { OPEN_NODES_BY_ORDER [ 0 ] . instance . step_back ( ) ; } } else { throw new Error ( ` ${ the_last_one_id } ` ) ; } }
Clears view by removing all the appended nodes before the one with resource-uid passed as `the_last_one_id`.
Clears view by removing all the appended nodes before the one with resource - uid passed as ` the_last_one_id ` .
// there is only one remained node! // make sure it's playable (Note: currently only content nodes clear up)