Skip to content

Commit c5c8b27

Browse files
author
Philip Guo
committed
make more unique IDs
1 parent 13b3319 commit c5c8b27

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎v3/js/pytutor.js‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ ExecutionVisualizer.prototype.renderPyCodeOutput = function() {
668668
return 'lineNo' + d.lineNumber;
669669
}
670670
else {
671-
return 'cod' + d.lineNumber;
671+
return myViz.generateID('cod' + d.lineNumber); // make globally unique (within the page)
672672
}
673673
})
674674
.html(function(d, i) {
@@ -1755,7 +1755,10 @@ ExecutionVisualizer.prototype.renderDataStructures = function() {
17551755

17561756
globalVarTable
17571757
.enter()
1758-
.append('tr');
1758+
.append('tr')
1759+
.attr('id', function(d, i) {
1760+
return myViz.generateID(varnameToCssID('globals__' + d)); // make globally unique (within the page)
1761+
});
17591762

17601763

17611764
var globalVarTableCells = globalVarTable
@@ -1914,7 +1917,10 @@ ExecutionVisualizer.prototype.renderDataStructures = function() {
19141917

19151918
stackVarTable
19161919
.enter()
1917-
.append('tr');
1920+
.append('tr')
1921+
.attr('id', function(d, i) {
1922+
return myViz.generateID(varnameToCssID(d.frame.unique_hash + '__' + d.varname)); // make globally unique (within the page)
1923+
});
19181924

19191925

19201926
var stackVarTableCells = stackVarTable

0 commit comments

Comments
 (0)