Skip to content

Commit c913ea6

Browse files
committed
Merge pull request #41 from cemc/cleancss
remove unneeded css; fix slider resize bug & update callback bug
2 parents a99c977 + 16b9f21 commit c913ea6

2 files changed

Lines changed: 14 additions & 12 deletions

File tree

‎v3/css/pytutor.css‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ div.ExecutionVisualizer #dataViz {
6060
margin-left: 25px;
6161
}
6262

63-
div.ExecutionVisualizer div#codeDisplayDiv {
63+
/*div.ExecutionVisualizer div#codeDisplayDiv {
6464
width: 550px;
65-
}
65+
}*/
6666

6767
div.ExecutionVisualizer div#pyCodeOutputDiv {
68-
max-width: 550px;
68+
/*max-width: 550px;*/
6969
max-height: 450px;
7070
/*max-height: 620px;*/
7171
overflow: auto;
@@ -529,6 +529,8 @@ div.ExecutionVisualizer #executionSlider {
529529

530530
margin-left: auto;
531531
margin-right: auto;
532+
533+
width: 95%;
532534
}
533535

534536
div.ExecutionVisualizer #executionSliderCaption {

‎v3/js/pytutor.js‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -441,17 +441,13 @@ ExecutionVisualizer.prototype.render = function() {
441441

442442

443443
if (this.params.codeDivWidth) {
444-
this.domRoot.find('#codeDisplayDiv')
445-
.css('width', this.params.codeDivWidth + 'px');
446-
447-
this.domRoot.find('#executionSlider')
448-
.css('width', (this.params.codeDivWidth - 20) + 'px');
444+
// set width once
445+
this.domRoot.find('#codeDisplayDiv').width(
446+
this.params.codeDivWidth);
447+
// it will propagate to the slider
449448
}
450449

451450
// enable left-right draggable pane resizer (originally from David Pritchard)
452-
$('#pyCodeOutputDiv,#codeDisplayDiv,#pyStdout').css({"max-width":"inherit"});
453-
$('#executionSlider').css({"width":"95%"});
454-
455451
var syncStdoutWidth = function(event, ui){
456452
$("#vizLayoutTdFirst #pyStdout").width(ui.size.width-2*parseInt($("#pyStdout").css("padding-left")));};
457453
$('#codeDisplayDiv').resizable({handles:"e", resize: syncStdoutWidth});
@@ -1536,7 +1532,11 @@ ExecutionVisualizer.prototype.updateOutput = function(smoothTransition) {
15361532
}
15371533
}
15381534
}
1539-
}
1535+
1536+
if (this.updateOutputCallback) {
1537+
this.updateOutputCallback();
1538+
}
1539+
} // end of updateOutput
15401540

15411541

15421542
// Pre-compute the layout of top-level heap objects for ALL execution

0 commit comments

Comments
 (0)