Add cleanly named methods to set the dimentions of both panels for both splitters.

This commit is contained in:
2026-06-21 22:29:00 +02:00
parent 0bca29de7b
commit 4c58d9b64a
2 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@tp/tp-splitter",
"version": "2.1.1",
"version": "2.2.0",
"description": "",
"main": "tp-splitter.js",
"scripts": {
+5 -1
View File
@@ -106,10 +106,14 @@ class TpHSplitter extends LitElement {
document.body.style['userSelect'] = '';
}
setHeight(height) {
setTopHeight(height) {
this.style.gridTemplateRows = `${height} var(--tp-splitter-width, 5px) 1fr`;
}
setBottomHeight(height) {
this.style.gridTemplateRows = `1fr var(--tp-splitter-width, 5px) ${height}`;
}
_enableDrag(e) {
e.preventDefault();
if (this.splitter && e.pointerId != null) {