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

feat(overlay): set overlay size #1583

Merged
merged 1 commit into from
Oct 25, 2016
Merged

feat(overlay): set overlay size #1583

merged 1 commit into from
Oct 25, 2016

Conversation

kara
Copy link
Contributor

@kara kara commented Oct 24, 2016

This PR adds two properties to the overlay state to manually configure the size of the overlay.

r: @jelbourn

@googlebot googlebot added cla: yes PR author has agreed to Google's Contributor License Agreement labels Oct 24, 2016
width: number;

/** The height of the overlay panel **/
height: number;
Copy link
Member

Choose a reason for hiding this comment

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

We should support percent with this as well. I'd make the type number|string, assume numbers are px and strings are whole units.

state.height = 500;

overlay.create(state).attach(componentPortal);
const pane = (<HTMLElement>overlayContainerElement.children[0]);
Copy link
Member

Choose a reason for hiding this comment

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

I want to start preferring the as cast syntax.

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM aside from a couple minor comments

@@ -58,6 +59,17 @@ export class OverlayRef implements PortalHost {
}
}

/** Updates the size of the overlay based on the overlay config. */
updateSize() {
if (this._state.width) {
Copy link
Member

Choose a reason for hiding this comment

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

It should probably work for zero as well.

@@ -98,3 +110,7 @@ export class OverlayRef implements PortalHost {
}
}
}

export function coerceToCSSFormat(value: number | string) {
Copy link
Member

Choose a reason for hiding this comment

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

formatCssUnit ?

Also it doesn't need to be exported just yet

@kara
Copy link
Contributor Author

kara commented Oct 25, 2016

@jelbourn Comments addressed!

@kara kara added the action: merge The PR is ready for merge by the caretaker label Oct 25, 2016
@kara kara merged commit ffbc295 into angular:master Oct 25, 2016
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants