Repository navigation
feat(viewport-ruler): add common window resize handler - #6680
Conversation
| merge<Event>( | ||
| fromEvent(window, 'resize'), | ||
| fromEvent(window, 'orientationchange') | ||
| ).subscribe(event => this._changed.next(event.type)); |
There was a problem hiding this comment.
Why subscribe and emit instead of exposing this Observable?
|
|
||
| constructor(scrollDispatcher: ScrollDispatcher) { | ||
| /** Stream of viewport change events. */ | ||
| private _changed = new Subject<string>(); |
There was a problem hiding this comment.
Is the difference between resize and orientationchange useful here? If we make it void we can change it to a more robust object later without it being a breaking change
There was a problem hiding this comment.
The intention was to let people react differently depending on the event, but we can always change it if somebody asks for it.
|
|
||
| // Subscribe to scroll and resize events and update the document rectangle on changes. | ||
| scrollDispatcher.scrolled(0, () => this._cacheViewportGeometry()); | ||
| this.change().subscribe(() => this._cacheViewportGeometry()); |
There was a problem hiding this comment.
Need to unsubscribe in ngOnDestroy?
|
Addressed the feedback @jelbourn. |
jelbourn
left a comment
There was a problem hiding this comment.
LGTM- can you amend your commit to include a breaking change message?
db65d66 to
6b09cb4
Compare
|
6b09cb4 to
2b4871d
Compare
|
Fixed @jelbourn. |
|
@crisbeto looks like prerender CI task is failing |
Adds the `change` method to the `ViewportRuler`, allowing for components to hook up to a common window resize handler. BREAKING CHANGE: Previously the `ScrollDispatcher.scrolled` subscription would react both on scroll events and on window resize events. Now it only reacts to scroll events. To react to resize events, subscribe to the `ViewportRuler.change()` stream.
2b4871d to
0748fb4
Compare
|
Sorted out the prerender failure. |
* Revert "Revert "fix(menu): multiple close events for a single close" (#7036)" This reverts commit dcfe515. * Revert "feat(datepicker): Add Moment.js adapter (#6860)" This reverts commit 9545427. * Revert "fix(menu): multiple close events for a single close (#6961)" This reverts commit 1cccd4b. * Revert "fix(menu): nested trigger staying highlighted after click (#6853)" This reverts commit 04bf3d1. * Revert "feat(viewport-ruler): add common window resize handler (#6680)" This reverts commit 881630f.
Adds the `change` method to the `ViewportRuler`, allowing for components to hook up to a common window resize handler. BREAKING CHANGE: Previously the `ScrollDispatcher.scrolled` subscription would react both on scroll events and on window resize events. Now it only reacts to scroll events. To react to resize events, subscribe to the `ViewportRuler.change()` stream.
…lar#7054) * Revert "Revert "fix(menu): multiple close events for a single close" (angular#7036)" This reverts commit dcfe515. * Revert "feat(datepicker): Add Moment.js adapter (angular#6860)" This reverts commit 9545427. * Revert "fix(menu): multiple close events for a single close (angular#6961)" This reverts commit 1cccd4b. * Revert "fix(menu): nested trigger staying highlighted after click (angular#6853)" This reverts commit 04bf3d1. * Revert "feat(viewport-ruler): add common window resize handler (angular#6680)" This reverts commit 881630f.
|
Is this public? And it's listed in beta 11, but I cannot seem to find the |
|
@rolandjitsu it was reverted and reopened #7113. I think that is an oversight in the changelog |
|
@willshowell thanks, I'll keep an eye on that. |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Adds the
changemethod to theViewportRuler, allowing for components to hook up to a common window resize handler.BREAKING CHANGE: Previously the
ScrollDispatcher.scrolledsubscription would react both on scroll events and on window resize events. Now it only reacts to scroll events. To react to resize events, subscribe to theViewportRuler.change()stream.