Skip to content

Commit

Permalink
dont always restore root components to 100%
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed Jul 7, 2023
1 parent 1e11510 commit 97c3219
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion haxe/ui/containers/SideBar.hx
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,13 @@ class SideBar extends Box {
if (r.hidden) {
continue;
}
if (r.percentWidth == null && r.percentHeight == null) {
continue;
}
if (r.classes.indexOf("sidebar") == -1) {
r.cachePercentSizes();
r.swapClass("sideBarModifyContent", "sideBarRestoreContent");
r.addClass("sidebarRestorable");
r.onAnimationEnd = function(_) {
r.onAnimationEnd = null;
rootComponent.removeClass("sideBarModifyContent");
Expand Down Expand Up @@ -381,8 +385,9 @@ class SideBar extends Box {
if (r.hidden) {
continue;
}
if (r.classes.indexOf("sidebar") == -1) {
if (r.classes.indexOf("sidebar") == -1 && r.classes.indexOf("sidebarRestorable") != -1) {
r.swapClass("sideBarRestoreContent", "sideBarModifyContent");
r.removeClass("sidebarRestorable");
r.onAnimationEnd = function(_) {
r.restorePercentSizes();
r.onAnimationEnd = null;
Expand Down

0 comments on commit 97c3219

Please sign in to comment.