flexible-connected-position-strategy.ts (material2-7.3.6) | : | flexible-connected-position-strategy.ts (material2-7.3.7) | ||
---|---|---|---|---|
skipping to change at line 307 | skipping to change at line 307 | |||
this._isPushed = true; | this._isPushed = true; | |||
this._applyPosition(fallback!.position, fallback!.originPoint); | this._applyPosition(fallback!.position, fallback!.originPoint); | |||
return; | return; | |||
} | } | |||
// All options for getting the overlay within the viewport have been exhaust ed, so go with the | // All options for getting the overlay within the viewport have been exhaust ed, so go with the | |||
// position that went off-screen the least. | // position that went off-screen the least. | |||
this._applyPosition(fallback!.position, fallback!.originPoint); | this._applyPosition(fallback!.position, fallback!.originPoint); | |||
} | } | |||
detach() { | detach(): void { | |||
this._clearPanelClasses(); | this._clearPanelClasses(); | |||
this._lastPosition = null; | this._lastPosition = null; | |||
this._previousPushAmount = null; | this._previousPushAmount = null; | |||
this._resizeSubscription.unsubscribe(); | this._resizeSubscription.unsubscribe(); | |||
} | } | |||
/** Cleanup after the element gets destroyed. */ | /** Cleanup after the element gets destroyed. */ | |||
dispose() { | dispose(): void { | |||
if (this._isDisposed) { | if (this._isDisposed) { | |||
return; | return; | |||
} | } | |||
// We can't use `_resetBoundingBoxStyles` here, because it resets | // We can't use `_resetBoundingBoxStyles` here, because it resets | |||
// some properties to zero, rather than removing them. | // some properties to zero, rather than removing them. | |||
if (this._boundingBox) { | if (this._boundingBox) { | |||
extendStyles(this._boundingBox.style, { | extendStyles(this._boundingBox.style, { | |||
top: '', | top: '', | |||
left: '', | left: '', | |||
skipping to change at line 372 | skipping to change at line 372 | |||
this._applyPosition(lastPosition, originPoint); | this._applyPosition(lastPosition, originPoint); | |||
} | } | |||
} | } | |||
/** | /** | |||
* Sets the list of Scrollable containers that host the origin element so that | * Sets the list of Scrollable containers that host the origin element so that | |||
* on reposition we can evaluate if it or the overlay has been clipped or outs ide view. Every | * on reposition we can evaluate if it or the overlay has been clipped or outs ide view. Every | |||
* Scrollable must be an ancestor element of the strategy's origin element. | * Scrollable must be an ancestor element of the strategy's origin element. | |||
*/ | */ | |||
withScrollableContainers(scrollables: CdkScrollable[]) { | withScrollableContainers(scrollables: CdkScrollable[]): this { | |||
this.scrollables = scrollables; | this.scrollables = scrollables; | |||
return this; | ||||
} | } | |||
/** | /** | |||
* Adds new preferred positions. | * Adds new preferred positions. | |||
* @param positions List of positions options for this overlay. | * @param positions List of positions options for this overlay. | |||
*/ | */ | |||
withPositions(positions: ConnectedPosition[]): this { | withPositions(positions: ConnectedPosition[]): this { | |||
this._preferredPositions = positions; | this._preferredPositions = positions; | |||
// If the last calculated position object isn't part of the positions anymor e, clear | // If the last calculated position object isn't part of the positions anymor e, clear | |||
End of changes. 4 change blocks. | ||||
3 lines changed or deleted | 4 lines changed or added |