From 60980c04f10213c61fe7b26912c6ef1e340548f9 Mon Sep 17 00:00:00 2001 From: k2s Date: Thu, 30 Jul 2020 17:23:33 +0200 Subject: [PATCH 1/2] Update jquery.splitter.css --- css/jquery.splitter.css | 1 + 1 file changed, 1 insertion(+) diff --git a/css/jquery.splitter.css b/css/jquery.splitter.css index 9077166..2edb498 100644 --- a/css/jquery.splitter.css +++ b/css/jquery.splitter.css @@ -45,6 +45,7 @@ .splitter_panel .vertical_panel { position: absolute; overflow: auto; + box-sizing: border-box; } .splitter_panel .vsplitter, From 3299aaa3c5b10d66924c9480a456439ee7619d07 Mon Sep 17 00:00:00 2001 From: k2s Date: Thu, 30 Jul 2020 17:24:28 +0200 Subject: [PATCH 2/2] Update jquery.splitter.js --- js/jquery.splitter.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/js/jquery.splitter.js b/js/jquery.splitter.js index 5b54c00..5c93a60 100644 --- a/js/jquery.splitter.js +++ b/js/jquery.splitter.js @@ -219,12 +219,14 @@ } else { var s_sum = splitter_dim * i; var props = {}; + var correction = settings.orientation == 'vertical' + ? parseInt(panels[i].css('marginLeft')) + parseInt(panels[i].css('marginRight')) + : parseInt(panels[i].css('marginTop')) + parseInt(panels[i].css('marginBottom')); + props[dim_name] = dim_px - pw - sw_sum - correction; + props[pos_name] = pw + sw_sum; if (settings.percent) { - props[dim_name] = (dim_px - pw - sw_sum) / dim_px * 100 + '%'; - props[pos_name] = (pw + sw_sum) / dim_px * 100 + '%'; - } else { - props[dim_name] = dim_px - pw - sw_sum; - props[pos_name] = pw + sw_sum; + props[dim_name] = props[dim_name] / dim_px * 100 + '%'; + props[pos_name] = props[pos_name] / dim_px * 100 + '%'; } panel_last.css(props); } @@ -266,7 +268,7 @@ self.find('.splitter_panel').trigger('splitter.resize'); splitters[id] = null; count--; - $splitters.each(function() { + $($splitters).each(function() { var splitter = $(this); splitter.off('mouseenter'); splitter.off('mouseleave');