mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-15 04:02:38 +00:00
further formatting
This commit is contained in:
@@ -27,14 +27,9 @@ const SplitPane = (props)=>{
|
|||||||
return ()=>window.removeEventListener('resize', handleResize);
|
return ()=>window.removeEventListener('resize', handleResize);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const limitPosition = (x, min = 1, max = window.innerWidth - 13)=>{
|
const limitPosition = (x, min = 1, max = window.innerWidth - 13)=>Math.round(Math.min(max, Math.max(min, x)));
|
||||||
return Math.round(Math.min(max, Math.max(min, x)));
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleResize = ()=>{
|
const handleResize = ()=>setDividerPos((pos)=>limitPosition(pos, 0.1 * (window.innerWidth - 13), 0.9 * (window.innerWidth - 13)));
|
||||||
setDividerPos((pos)=>limitPosition(pos, 0.1 * (window.innerWidth - 13), 0.9 * (window.innerWidth - 13))
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleUp =(e)=>{
|
const handleUp =(e)=>{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|||||||
Reference in New Issue
Block a user