Skip to content

Commit 3e81c4a

Browse files
authored
Merge pull request #719 from Rahulm2310/codeoverlappingfix
Fixed the example code overlapping
2 parents 0142b5d + 9022665 commit 3e81c4a

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/assets/js/render.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,18 @@ var renderCode = function(exampleName) {
152152
edit_area.style.display = 'block';
153153
edit_area.focus();
154154
} else {
155-
$('.example_container').each(function(ind, con) {
156-
$(con).css('opacity', 1.0);
157-
$(con).removeClass('editing');
158-
});
159155
edit_button.innerHTML = 'edit';
160156
edit_area.style.display = 'none';
161157
sketch.textContent = edit_area.value;
158+
$('.example_container').each(function (ind, con) {
159+
$(con).css('opacity', 1.0);
160+
$(con).removeClass('editing');
161+
$this = $(this);
162+
var pre = $this.find('pre')[0];
163+
if (pre) {
164+
$this.height(Math.max($(pre).height(), 100) + 20);
165+
}
166+
});
162167
runCode(sketch, true, i);
163168
}
164169
}

0 commit comments

Comments
 (0)