Skip to content

Commit 1a5a337

Browse files
committed
Fix a JS error
1 parent e228527 commit 1a5a337

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

static/rustw.out.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,10 +1055,12 @@ function make_highlight(src_line_prefix, line_number, left, right, css_class) {
10551055
}
10561056

10571057
var offset = line_div.offset();
1058-
line_div.after(highlight);
1059-
offset.left += left;
1060-
highlight.offset(offset);
1061-
highlight.width(width);
1058+
if (offset) {
1059+
line_div.after(highlight);
1060+
offset.left += left;
1061+
highlight.offset(offset);
1062+
highlight.width(width);
1063+
}
10621064
}
10631065

10641066
/***/ }),
@@ -6601,6 +6603,11 @@ var ContentPanel = exports.ContentPanel = function (_React$Component) {
66016603
value: function componentDidMount() {
66026604
this.query_api(this.props.path);
66036605
}
6606+
}, {
6607+
key: 'componentDidUpdate',
6608+
value: function componentDidUpdate() {
6609+
document.title = 'cargo src - ' + this.props.path;
6610+
}
66046611
}, {
66056612
key: 'UNSAFE_componentWillReceiveProps',
66066613
value: function UNSAFE_componentWillReceiveProps(nextProps) {
@@ -7505,6 +7512,11 @@ var SourceView = exports.SourceView = function (_React$Component) {
75057512
}
75067513

75077514
_createClass(SourceView, [{
7515+
key: 'componentWillUnmount',
7516+
value: function componentWillUnmount() {
7517+
console.log("unmount");
7518+
}
7519+
}, {
75087520
key: 'componentDidMount',
75097521
value: function componentDidMount() {
75107522
this.componentDidUpdate();

static/rustw.out.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/utils.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,10 @@ function make_highlight(src_line_prefix, line_number, left, right, css_class) {
172172
}
173173

174174
var offset = line_div.offset();
175-
line_div.after(highlight);
176-
offset.left += left;
177-
highlight.offset(offset);
178-
highlight.width(width);
175+
if (offset) {
176+
line_div.after(highlight);
177+
offset.left += left;
178+
highlight.offset(offset);
179+
highlight.width(width);
180+
}
179181
}

0 commit comments

Comments
 (0)