Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix notification drawer accordion panel sizing #548

Merged
merged 1 commit into from
Aug 4, 2017

Conversation

jeff-phillips-18
Copy link
Member

Description

Update sizes when elements in the notification drawer are updated.
Update collapse children to not have a intermediate parent.
Fix for example notification drawer body html indentation error.

Fixes #545

@benjaminapetersen

@@ -78,24 +85,21 @@ angular.module('patternfly.utils').directive('pfFixedAccordion', function ($wind

if (angular.isDefined($scope.scrollSelector)) {
scroller = angular.element(collapsePanel[0].querySelector($scope.scrollSelector));
if (scroller.length === 1) {
if (scroller.length > 0) {
scrollElement = angular.element(scroller[0]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit. could remove "> 0"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Update sizes when elements in the notification drawer are updated.
Update collapse children to not have a intermediate parent.
Fix for example notification drawer body html indentation error.

Fixes patternfly#545
@@ -51,6 +51,12 @@ angular.module('patternfly.notification').component('pfNotificationDrawer', {
});
};

var updateAccordionSizing = function () {
$timeout(function () {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any concerns about performance here? if $onChanges is triggered frequently, do you want to be triggering resize often, or would a debounce/throttle be in order? I'm also curious about 100, vs (0 or any other small #) if its arbitrary or standardized across patternfly angular for this kind of thing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe onChanges will get call that frequently. Typically most of these won't change, but should they, the size needs to be recalculated. Also, its only done if the draw is shown and one of these values change.

We've typically used 100 just to get past any follow up changes and get thru a digest cycle or two. Main idea is to get past the current digest cycle anyhow.

Copy link
Member

@cdcabrera cdcabrera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a consistency nit for truthy check. @benjaminapetersen comment about $timeout vs $onChanges looks like it warrants a look if you haven't already.

@@ -19,16 +19,15 @@ <h4 class="panel-title">
<span class="panel-counter" ng-include src="$ctrl.subheadingInclude"></span>
</div>
<div class="panel-collapse collapse" ng-class="{in: notificationGroup.open || $ctrl.notificationGroups.length === 1}">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: truthy check instead...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Truthy ~ $ctrl.notificationGroups.length vs $ctrl.notificationGroups.length === 1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it must be exactly 1.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, this is the single panel option. Sorry, just saw the truthy "huh" :)

@benjaminapetersen
Copy link
Member

@jeff-phillips-18 I've built this & pulled it into the console to test. Works much better, big improvement, thx!

@cdcabrera cdcabrera merged commit b7779a1 into patternfly:master Aug 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants