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(menu): add custom position support to menu #893

Merged
merged 2 commits into from
Jul 22, 2016

Conversation

kara
Copy link
Contributor

@kara kara commented Jul 21, 2016

r: @jelbourn

This PR adds custom position support to menu. The default menu opens "after" and "below" the trigger. If you want to change that, you can modify the "x-position" and "y-position" attributes (see design doc here).

x-position: 'before' | 'after'
y-position: 'above' | 'below'

Examples:

<md-menu x-position="before">
...
</md-menu>

FYI, this PR needs to wait until my other menu PR goes in, so check out the last commit.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jul 21, 2016
@@ -22,10 +24,21 @@ import {
})
export class MdMenu {
private _showClickCatcher: boolean = false;
private _classList: Object;
positionX: 'before' | 'after' = 'after';
positionY: 'above' | 'below' = 'below';
Copy link
Member

Choose a reason for hiding this comment

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

Create a type for these, i.e.,

export type MenuPositionX: 'before' | 'after';

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call! Way better.

@kara
Copy link
Contributor Author

kara commented Jul 21, 2016

@jelbourn comments should be addressed:
0829631

page = new MenuPage();
});

it('should open menu when the trigger is clicked', function () {
Copy link
Member

Choose a reason for hiding this comment

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

() =>

Copy link
Contributor Author

@kara kara Jul 21, 2016

Choose a reason for hiding this comment

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

Oh, whoa. Updated!

@@ -22,10 +26,34 @@ import {
})
export class MdMenu {
private _showClickCatcher: boolean = false;
private _classList: Object;
Copy link
Member

Choose a reason for hiding this comment

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

Object isn't super clear; add a comment explaining that this is the input into ngClass with an example?

@jelbourn
Copy link
Member

LGTM aside from existing comments; did you figure out the scrollbars on SauceLabs thing?

@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.

4 participants