-
Notifications
You must be signed in to change notification settings - Fork 90
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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}"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: truthy check instead... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. huh? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Truthy ~ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But it must be exactly 1. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" :) |
||
<div ng-if="$ctrl.hasNotifications(notificationGroup)"> | ||
<div class="panel-body"> | ||
<div class="drawer-pf-notification" ng-class="{unread: notification.unread, 'expanded-notification': $ctrl.drawerExpanded}" | ||
ng-repeat="notification in notificationGroup.notifications" ng-include src="$ctrl.notificationBodyInclude"> | ||
</div> | ||
<div ng-if="notificationGroup.isLoading" class="drawer-pf-loading text-center"> | ||
<span class="spinner spinner-xs spinner-inline"></span> Loading More | ||
</div> | ||
<div ng-if="$ctrl.hasNotifications(notificationGroup)" class="panel-body"> | ||
<div class="drawer-pf-notification" ng-class="{unread: notification.unread, 'expanded-notification': $ctrl.drawerExpanded}" | ||
ng-repeat="notification in notificationGroup.notifications" ng-include src="$ctrl.notificationBodyInclude"> | ||
</div> | ||
<div ng-if="notificationGroup.isLoading" class="drawer-pf-loading text-center"> | ||
<span class="spinner spinner-xs spinner-inline"></span> Loading More | ||
</div> | ||
<div class="drawer-pf-action"> | ||
</div> | ||
<div ng-if="($ctrl.showClearAll || $ctrl.showMarkAllRead) && $ctrl.hasNotifications(notificationGroup)" class="drawer-pf-action"> | ||
<span class="drawer-pf-action-link" ng-if="$ctrl.showMarkAllRead && $ctrl.hasUnread(notificationGroup)"> | ||
<button class="btn btn-link" ng-click="$ctrl.onMarkAllRead(notificationGroup)">Mark All Read</button> | ||
</span> | ||
|
@@ -38,10 +37,9 @@ <h4 class="panel-title"> | |
Clear All | ||
</button> | ||
</span> | ||
</div> | ||
<div class="drawer-pf-action" ng-if="$ctrl.actionButtonTitle"> | ||
<a class="btn btn-link btn-block" ng-click="$ctrl.actionButtonCallback(notificationGroup)">{{$ctrl.actionButtonTitle}}</a> | ||
</div> | ||
</div> | ||
<div ng-if="$ctrl.actionButtonTitle && $ctrl.hasNotifications(notificationGroup)" class="drawer-pf-action"> | ||
<a class="btn btn-link btn-block" ng-click="$ctrl.actionButtonCallback(notificationGroup)">{{$ctrl.actionButtonTitle}}</a> | ||
</div> | ||
<div ng-if="!$ctrl.hasNotifications(notificationGroup)"> | ||
<div class="panel-body"> | ||
|
There was a problem hiding this comment.
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 adebounce
/throttle
be in order? I'm also curious about100
, vs (0
or any other small #) if its arbitrary or standardized across patternfly angular for this kind of thing.There was a problem hiding this comment.
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.