Skip to content

Commit

Permalink
Free up minimize slot when closing window
Browse files Browse the repository at this point in the history
  • Loading branch information
1j01 committed Jun 5, 2024
1 parent ce0a55d commit 1f72e6f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions $Window.js
Original file line number Diff line number Diff line change
Expand Up @@ -1683,6 +1683,8 @@ You can also disable this warning by passing {iframes: {ignoreCrossOrigin: true}
$component.detach();
}
$w.closed = true;
minimize_slots[$w._minimize_slot_index] = null;

$event_target.triggerHandler("closed");
$w.trigger("closed");
// TODO: change usages of "close" to "closed" where appropriate
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The API is unstable, and [Semantic Versioning](https://semver.org/spec/v2.0.0.ht
### Fixed

- Fixed positioning of windows when minimized without a taskbar.
- Closing a window now frees up its minimize slot at the bottom of the screen (if there's no taskbar). Previously only unminimizing did this.

</details>

Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/windows.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ describe('$Window Component', () => {
title: 'Test Window 3',
minimizeButton: true,
});
$window.close(); // free up slot
$window.close(); // free up slot (unminimizing should also do this)
$window3.minimize();
cy.get('.window').should('have.length', 2);
cy.get('.window').last().should('have.css', 'bottom', '-3px');
// cy.get('.window').last().should('have.css', 'left', '10px'); // FIXME: it's getting placed in the third slot, not the first
cy.get('.window').last().should('have.css', 'left', '10px');
});
});
});
Expand Down

0 comments on commit 1f72e6f

Please sign in to comment.