Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit e7103c4

Browse files
whummerSomeKittens
authored andcommitted
feat(css-hidden): add/remove class "ui-layout-hidden" for hidden containers
If a container has content with absolute positioning and non-zero padding, the contents of the containers overlap if either of them gets collapsed. This commit adds a class attribute and CSS style to avoid rendering the hidden elements.
1 parent e3461bb commit e7103c4

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/ui-layout.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,3 +152,8 @@
152152
overflow: visible;
153153
}
154154
}
155+
156+
/* Make sure hidden elements are in fact not rendered. */
157+
.ui-layout-hidden {
158+
display: none;
159+
}

src/ui-layout.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,11 @@ angular.module('ui.layout', [])
928928

929929
scope.$watch('container.size', function(newValue) {
930930
element.css(ctrl.sizeProperties.sizeProperty, newValue + 'px');
931+
if(newValue === 0) {
932+
element.addClass('ui-layout-hidden');
933+
} else {
934+
element.removeClass('ui-layout-hidden');
935+
}
931936
});
932937

933938
scope.$watch('container.' + ctrl.sizeProperties.flowProperty, function(newValue) {

0 commit comments

Comments
 (0)