fix(pfVerticalNavigation): Fixed resizing not hiding/showing the navigation correctly #729
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #728
Description
Fixes an issue with the vertical navigation, where the classes won't be updated when resizing based on the ng-class definition. This was causing the navigation to remain shown when resizing to a smaller window and then remaining hidden when resizing back to a larger screen, until some event in the application caused a $digest to occur. Upon investigating the issue, this is caused by the resize event handler being processed outside of AngularJS's context and therefore won't trigger any watchers and won't update the classes based on the ng-class definition.
Note: This is actually a regression between 3.x -> 4.x, though I've fixed this in a slightly different way to 3.x, so that this only triggers a digest on the isolated component scope, instead of the root scope. This approach means it should be better for performance, as it only needs to evaluate the watchers in the component scope, instead of evaluating all watchers.
PR Checklist