Skip to content

Commit e4781eb

Browse files
authored
fix: Fix the split in HTML at 33/67% instead of calculating percentages (#939)
Previously this was calculated so that the left page would expand to its natural size. That's not really what we want, because the natural size could be as high as 100%. Fixes #927
1 parent c43701b commit e4781eb

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/default_theme/assets/site.js

+1-10
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,6 @@ split_left.style.overflow = 'hidden';
113113
var cw_without_sb = split_left.clientWidth;
114114
split_left.style.overflow = '';
115115

116-
// Need to add:
117-
// - Half of gutterSize (i.e. 10) because gutter will take that much from each.
118-
// - Scrollbar width (cw_with_sb - cw_without_sb), if it takes up existing
119-
// space (Firefox) rather than adding the scrollbar to the side (Chrome)
120-
var percent_left =
121-
(split_left.getBoundingClientRect().width + 10 + cw_without_sb - cw_with_sb) /
122-
split_parent.getBoundingClientRect().width *
123-
100;
124-
125116
Split(['#split-left', '#split-right'], {
126117
elementStyle: function(dimension, size, gutterSize) {
127118
return {
@@ -134,7 +125,7 @@ Split(['#split-left', '#split-right'], {
134125
};
135126
},
136127
gutterSize: 20,
137-
sizes: [percent_left, 100 - percent_left]
128+
sizes: [33, 67]
138129
});
139130

140131
// Chrome doesn't remember scroll position properly so do it ourselves.

0 commit comments

Comments
 (0)