Skip to content

Commit c464367

Browse files
author
Philip Guo
committed
more grossly hacks for IE
1 parent 6291643 commit c464367

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

‎v3/css/pytutor.css‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ div.ExecutionVisualizer table#pyCodeOutput td {
9999

100100
div.ExecutionVisualizer #leftCodeGutterSVG {
101101
width: 18px;
102+
height: 0px; /* programmatically set this later ... IE needs this to
103+
be 0 or it defaults to something arbitrary and gross */
102104
}
103105

104106
div.ExecutionVisualizer .arrow {

‎v3/js/pytutor.js‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,10 @@ ExecutionVisualizer.prototype.updateOutput = function() {
736736

737737
assert(this.curTrace);
738738

739+
// there's no point in re-rendering if this pane isn't even visible in the first place!
740+
if (!myViz.domRoot.is(':visible')) {
741+
return;
742+
}
739743

740744
// set the gutter's height to match that of its parent
741745
// (we often can't do this earlier since the entire pane
@@ -749,7 +753,10 @@ ExecutionVisualizer.prototype.updateOutput = function() {
749753

750754
// this weird contortion is necessary to get the accurate row height on Internet Explorer
751755
// (simpler methods work on all other major browsers, erghhhhhh!!!)
752-
var rowHeight = 0;
756+
757+
// first take care of edge case when there's only one line ...
758+
var rowHeight = myViz.domRoot.find('table#pyCodeOutput td.cod:first').height();
759+
// ... then handle the (much more common) multi-line case ...
753760
if (this.codeOutputLines && this.codeOutputLines.length > 1) {
754761
rowHeight = (myViz.domRoot.find('table#pyCodeOutput tr:nth-child(2)').offset().top -
755762
myViz.domRoot.find('table#pyCodeOutput tr:first').offset().top);

0 commit comments

Comments
 (0)