diff --git a/website/o3dv/js/navigator.js b/website/o3dv/js/navigator.js index 97dd327..e1e540a 100644 --- a/website/o3dv/js/navigator.js +++ b/website/o3dv/js/navigator.js @@ -119,23 +119,8 @@ OV.Navigator = class } }); - let originalWidth = null; - OV.CreateVerticalSplitter (this.splitterDiv, { - onSplitStart : () => { - originalWidth = this.mainDiv.outerWidth (true); - }, - onSplit : (xDiff) => { - const minWidth = 280; - const maxWidth = 450; - let newWidth = originalWidth + xDiff; - if (newWidth < minWidth) { - newWidth = minWidth; - } else if (newWidth > maxWidth) { - newWidth = maxWidth; - } - this.mainDiv.outerWidth (newWidth, true); - this.callbacks.onResize (); - } + OV.InstallVerticalSplitter (this.splitterDiv, this.mainDiv, false, () => { + this.callbacks.onResize (); }); } diff --git a/website/o3dv/js/sidebar.js b/website/o3dv/js/sidebar.js index dda2798..deb5ca5 100644 --- a/website/o3dv/js/sidebar.js +++ b/website/o3dv/js/sidebar.js @@ -59,23 +59,8 @@ OV.Sidebar = class } ); - let originalWidth = null; - OV.CreateVerticalSplitter (this.splitterDiv, { - onSplitStart : () => { - originalWidth = this.mainDiv.outerWidth (true); - }, - onSplit : (xDiff) => { - const minWidth = 280; - const maxWidth = 450; - let newWidth = originalWidth - xDiff; - if (newWidth < minWidth) { - newWidth = minWidth; - } else if (newWidth > maxWidth) { - newWidth = maxWidth; - } - this.mainDiv.outerWidth (newWidth, true); - this.callbacks.onResize (); - } + OV.InstallVerticalSplitter (this.splitterDiv, this.mainDiv, true, () => { + this.callbacks.onResize (); }); } diff --git a/website/o3dv/js/utils.js b/website/o3dv/js/utils.js index e08e848..9001cb8 100644 --- a/website/o3dv/js/utils.js +++ b/website/o3dv/js/utils.js @@ -154,3 +154,30 @@ OV.CreateInlineColorCircle = function (color) let darkerColorHexString = '#' + OV.ColorToHexString (darkerColor); return $('