Closed caco3 closed 8 years ago
And when I try to run the jump update command hrmv.updateJumpArrows();
, I also get errors:
TypeError: this.root is undefined
var table_width = this.root.outerWidth();
As you're downloading the code from an external location, when hrmv.setActiveLine
is called there are no lines yet to make active as there is no code (the AJAX request is kicked off in the background so setActiveLine
is called before it completes). I suggest doing the downloading yourself:
var hrmv;
function fonts_loaded() {
function showCode(source) {
hrmv = new HRMViewer('code', source);
hrmv.setActiveLine(5);
}
// download the code ourselves so we can trigger the active line change
$.ajax({
url: 'asm/program.asm',
success: showCode,
dataType: 'text'
});
}
WebFont.load({
google: { families: ['Passion One'] },
active: fonts_loaded,
inactive: fonts_loaded,
});
Thank you very much for your quick response!
Hi, thank you very much for your cool viewer. I am trying to implement it into my own PHP based interpreter. Now I wanted to highlight the active line, but I get the following error:
TypeError: this.line_to_row is undefined
this.active_row = this.line_to_row[line_num];
What am I doing wrong? This is the code I have: