Skip to content

Commit

Permalink
v0.7.9
Browse files Browse the repository at this point in the history
  • Loading branch information
nealus committed Aug 6, 2023
1 parent 4091197 commit 0528ba2
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 17 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.7.9
Fix drag issue found when used in devtool extension
Fix double render in popout when in strict mode

0.7.8
Fix popout size of tab with individual border size
Hide edge handles when disabled
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flexlayout-react",
"version": "0.7.8",
"version": "0.7.9",
"description": "A multi-tab docking layout manager",
"main": "lib/index.js",
"types": "./declarations/index.d.ts",
Expand Down
8 changes: 4 additions & 4 deletions src/DragDrop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ export class DragDrop {
return;
}

if (this._dragging) {
return;
}

this._lastEvent = event;

if (currentDocument) {
Expand All @@ -169,10 +173,6 @@ export class DragDrop {
const posEvent = this._getLocationEvent(event);
this.addGlass(fDragCancel);

if (this._dragging) {
console.warn("this._dragging true on startDrag should never happen");
}

if (event) {
this._startX = posEvent.clientX;
this._startY = posEvent.clientY;
Expand Down
28 changes: 16 additions & 12 deletions src/view/FloatingWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const FloatingWindow = (props: React.PropsWithChildren<IFloatingWindowPro
if (timerId.current) {
clearTimeout(timerId.current);
}
let isMounted = true;
const r = rect;
// Make a local copy of the styles from the current window which will be passed into
// the floating window. window.document.styleSheets is mutable and we can't guarantee
Expand Down Expand Up @@ -68,26 +69,29 @@ export const FloatingWindow = (props: React.PropsWithChildren<IFloatingWindowPro
});

popoutWindow.current.addEventListener("load", () => {
const popoutDocument = popoutWindow.current!.document;
popoutDocument.title = title;
const popoutContent = popoutDocument.createElement("div");
popoutContent.className = CLASSES.FLEXLAYOUT__FLOATING_WINDOW_CONTENT;
popoutDocument.body.appendChild(popoutContent);
copyStyles(popoutDocument, styles).then(() => {
setContent(popoutContent);
});
if (isMounted) {
const popoutDocument = popoutWindow.current!.document;
popoutDocument.title = title;
const popoutContent = popoutDocument.createElement("div");
popoutContent.className = CLASSES.FLEXLAYOUT__FLOATING_WINDOW_CONTENT;
popoutDocument.body.appendChild(popoutContent);
copyStyles(popoutDocument, styles).then(() => {
setContent(popoutContent);
});

// listen for popout unloading (needs to be after load for safari)
popoutWindow.current!.addEventListener("beforeunload", () => {
onCloseWindow(id);
});
// listen for popout unloading (needs to be after load for safari)
popoutWindow.current!.addEventListener("beforeunload", () => {
onCloseWindow(id);
});
}
});
} else {
console.warn(`Unable to open window ${url}`);
onCloseWindow(id);
}

return () => {
isMounted = false;
// delay so refresh will close window
timerId.current = setTimeout(() => {
if (popoutWindow.current) {
Expand Down

0 comments on commit 0528ba2

Please sign in to comment.