Skip to content

Commit 5364dc8

Browse files
committed
Add resizing element
1 parent 181bd53 commit 5364dc8

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/renderer/components/HelmetProject/Runtime/Runtime.css

+1-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@
2828

2929
.Runtime__scenarios_controls_drag_handle {
3030
cursor: row-resize;
31-
height: 20px;
32-
background-color: #00985F;
33-
position: absolute;
34-
z-index: 1;
31+
height: 50px;
3532
}
3633

3734
.Runtime__scenarios-heading {

src/renderer/components/HelmetProject/Runtime/Runtime.jsx

+7-2
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ const Runtime = ({
131131
}
132132

133133
const onMouseDown = (e) => {
134-
if (e.pageY > (e.target.offsetTop + parseInt(getComputedStyle(resizableDiv, '').height)) - 20) {
134+
if (e.pageY > (e.target.offsetTop + e.target.offsetHeight)) {
135135
mousePosition = e.y;
136136
document.addEventListener("mousemove", resize, false);
137137
}
@@ -141,6 +141,10 @@ const Runtime = ({
141141
document.removeEventListener("mousemove", resize, false);
142142
}
143143

144+
const onMouseOut = () => {
145+
document.removeEventListener("mousemove", resize, false);
146+
}
147+
144148
return (
145149
<div className="Runtime">
146150

@@ -159,7 +163,7 @@ const Runtime = ({
159163
</div>
160164
</div>
161165

162-
<div className="Runtime__scenarios-controls" id="resizableDiv" onMouseDown={onMouseDown} onMouseUp={onMouseUp}>
166+
<div className="Runtime__scenarios-controls" id="resizableDiv">
163167
<div className="Runtime__scenarios-heading">Ladatut skenaariot</div>
164168
<div className="Runtime__scenarios">
165169
{/* Create table of all scenarios "<Button-To-Add-As-Runnable> <Button-To-Open-Configuration>" */}
@@ -252,6 +256,7 @@ const Runtime = ({
252256
</button>
253257
</div>
254258
</div>
259+
<div className="Runtime__scenarios_controls_drag_handle" onMouseDown={onMouseDown} onMouseUp={onMouseUp} onMouseOut={onMouseOut} />
255260

256261
<div className="Runtime__start-stop-controls">
257262
<div className="Runtime__heading">Ajettavana</div>

0 commit comments

Comments
 (0)