Minor fixes

mistress
Yuki 1 year ago
parent 8beb5eb362
commit f5dc69d252

@ -12,7 +12,7 @@ body {
.window {
position: absolute;
overflow: auto;
overflow: hidden;
height: 300px;
width: 500px;
top: 16px;
@ -26,6 +26,7 @@ body {
.window-body {
padding: 8px 12px;
height: calc(100% - 52px);
width: calc(100% - 38px);
overflow: auto;
}

@ -9,6 +9,7 @@ function makeDraggable(elmnt) {
function dragMouseDown(e) {
if(e.button != 0) return;
if(e.target.className == "title-bar-controls" || (e.target.parentElement && e.target.parentElement.className == "title-bar-controls")) return;
e.preventDefault();
previousPosX = e.clientX;
previousPosY = e.clientY;
@ -79,7 +80,8 @@ function makeResizable(elmnt) {
var my = e.clientY - elmnt.offsetTop;
doX = (my < (elmnt.offsetHeight - 8) || mx > (elmnt.offsetWidth - 8) || mx < 8);
doY = (my >= (elmnt.offsetHeight - 8));
xDir = (mx < (elmnt.offsetWidth - 8));
xDir = (mx < 8);
console.log(xDir, mx, elmnt.offsetWidth - 8);
document.addEventListener("mouseup", closeResizeElement);
document.addEventListener("mousemove", elementResize);
}
@ -87,9 +89,9 @@ function makeResizable(elmnt) {
function elementResize(e) {
e.preventDefault();
let x = e.clientX - startX;
if(doX) elmnt.style.width = (startWidth + (xDir ? -x : x)) + 'px';
if(doX) elmnt.style.width = Math.max((startWidth + (xDir ? -x : x)), 180) + 'px';
if(xDir) elmnt.style.left = (e.clientX) + 'px';
if(doY) elmnt.style.height = (startHeight + e.clientY - startY) + 'px';
if(doY) elmnt.style.height = Math.max((startHeight + e.clientY - startY), 100) + 'px';
}
function closeResizeElement() {

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save