Skip to content

Commit 7cb285d

Browse files
committed
Backport PR #1956: Make the font size more robust against fickle browser values.
Also change the line-height multiplier to 1.3, which is closer to what the CSS is (I think it is 1.21 something.) Thanks to williamstein and haraldschilly for bringing this to our attention: sagemathinc/cocalc#1262 We also re-enable auto scrolling for Firefox, since this might have been the issue. Signed-off-by: Min RK <[email protected]>
1 parent a53a215 commit 7cb285d

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

notebook/static/notebook/js/outputarea.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ define([
9191
return false;
9292
}
9393
// line-height from http://stackoverflow.com/questions/1185151
94-
var fontSize = this.element.css('font-size');
95-
var lineHeight = Math.floor(parseInt(fontSize.replace('px','')) * 1.5);
94+
var fontSize = this.element.css('font-size') || '14px';
95+
var lineHeight = Math.floor((parseFloat(fontSize.replace('px','')) || 14) * 1.3);
9696
return (this.element.height() > threshold * lineHeight);
9797
};
9898

@@ -103,10 +103,6 @@ define([
103103
this.prompt_overlay.click(function () { that.toggle_scroll(); });
104104

105105
this.element.resize(function () {
106-
// FIXME: Firefox on Linux misbehaves, so automatic scrolling is disabled
107-
if ( utils.browser[0] === "Firefox" ) {
108-
return;
109-
}
110106
// maybe scroll output,
111107
// if it's grown large enough and hasn't already been scrolled.
112108
if (!that.scrolled && that._should_scroll()) {

0 commit comments

Comments
 (0)