Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

md-menu as secondary action inside md-list-item #3339

Closed
dohomi opened this issue Jun 18, 2015 · 23 comments
Closed

md-menu as secondary action inside md-list-item #3339

dohomi opened this issue Jun 18, 2015 · 23 comments
Assignees
Labels
has: Pull Request A PR has been created to address this issue P4: minor Minor issues. May not be fixed without community contributions. ux: integration

Comments

@dohomi
Copy link

dohomi commented Jun 18, 2015

Hello,

I would like to know if it is planned to add md-menu as secondary action to md-list-itemcomponent. Currently it is possible with custom markup, a better support would be highly appreciated! Thanks a lot for this component.

@ntatic
Copy link

ntatic commented Jun 19, 2015

Can you post snippet how did you make it with custom markup. I didn't have luck with it.

@dohomi
Copy link
Author

dohomi commented Jun 22, 2015

@ntatic here is the code I came up with. I think most importantly don't use ng-click on the md-list-itemitself.

   <md-list>
                <md-list-item class="md-3-line" ng-repeat="training in vm.trainingList">
                    <div class="md-list-item-text" ng-click="$state.go('more_link'})">
                        <h3 class="md-subtitle">{{title}}</h3>
                        <h4>{{description}}</h4>
                        <p class="md-body-1">
                            {{more_info}}
                        </p>
                    </div>
                    <md-menu md-position-mode="target-right target">
                        <md-button class="md-icon-button" aria-label="{{'OPEN' | translate}}" ng-click="$mdOpenMenu()">
                            <md-icon md-menu-origin>more_vert</md-icon>
                        </md-button>
                        <md-menu-content width="3">
                            <md-menu-item>
                                <md-button ng-click="">
                                    <p>copy</p>
                                    <md-icon md-menu-align-target>content_copy</md-icon>
                                </md-button>
                            </md-menu-item>
                            <md-menu-divider></md-menu-divider>
                            <md-menu-item>
                                <md-button ng-click="">
                                    <p>delete</p>
                                    <md-icon md-menu-align-target>clear</md-icon>
                                </md-button>
                            </md-menu-item>
                        </md-menu-content>
                    </md-menu>
                </md-list-item>
            </md-list>

@rgolea
Copy link

rgolea commented Jun 22, 2015

+1

2 similar comments
@TylerDixon
Copy link

+1

@houmark
Copy link

houmark commented Jun 22, 2015

+1

@houmark
Copy link

houmark commented Jun 22, 2015

Related to #3218 by the way. And I just tested your "workaround" and unfortunately it doesn't work in our md-list.

@bradmartin
Copy link

I've got the menu working inside but issue with separating the items.

     <md-list-item class="md-3-line" ng-repeat="user in users">
            <ng-md-icon class="md-avatar"
                        icon="person"
                        ng-show="!user.ProfilePic"
                        style="fill: #4a65ff"></ng-md-icon>
            <img alt="{{user.Name}}" ng-src="{{ user.ProfilePic }}"
                 ng-show="user.ProfilePic"
                 class="md-avatar" />
            <div class="md-list-item-text">
                <h3>
                    {{user.Name}}
                </h3>
                <h4>{{user.Email}}</h4>
                <p>
                    <span ng-if="user.LastLogin">Last login: {{user.LastLogin | date: 'short'}}</span>
                    <span ng-if="!user.LastLogin">Last login: Never</span>
                </p>
            </div>
            <md-menu md-offset="0 -7">
                <md-button aria-label="Open user detail menu"
                           class="md-icon-button"
                           ng-click="$mdOpenMenu($event)">
                    <ng-md-icon md-menu-origin icon="more_vert"
                                style="fill: #444;"></ng-md-icon>
                </md-button>
                <md-menu-content>
                    <md-menu-item>
                        <md-button ng-click="openResetPasswordDialog(user, $event)">
                            <span md-menu-align-target>Reset Password</span>
                        </md-button>
                    </md-menu-item>
                    <md-menu-item>
                        <md-button ng-click="openRenameUserDialog(user, $event)">
                            <span md-menu-align-target>Rename User</span>
                        </md-button>
                    </md-menu-item>

            </md-menu>

            <!--<md-divider ng-if="!$last"></md-divider>-->

        </md-list-item>

@mribichich
Copy link

+1

@ThomasBurleson ThomasBurleson modified the milestone: Backlog Jul 6, 2015
@AleksueiR
Copy link

+1

2 similar comments
@andrea-vega
Copy link

+1

@rezonant
Copy link

rezonant commented Sep 3, 2015

+1

@ThomasBurleson ThomasBurleson added for: internal contributor The team will address this issue and community PRs are not requested. ux: integration priority: medium needs: UX team review and removed for: internal contributor The team will address this issue and community PRs are not requested. labels Sep 4, 2015
@ThomasBurleson ThomasBurleson modified the milestones: post-1.0 , Backlog Sep 4, 2015
@gpopovic
Copy link

+1

@ThomasBurleson ThomasBurleson modified the milestones: 0.12.0, post-1.0 Sep 22, 2015
@sch4lly
Copy link

sch4lly commented Oct 1, 2015

+1

1 similar comment
@dunmaksim
Copy link

+1

@marvinosswald
Copy link

+1 got it working on safari, chrome but not firefox

@ThomasBurleson ThomasBurleson modified the milestones: 1.0-rc1, 1.0-rc2 Oct 27, 2015
@ismarslomic
Copy link

+1

devversion added a commit to devversion/material that referenced this issue Feb 1, 2016
- Allow md-menu to be a proxied element in a list
- Smart detection of being right or left aligned
- Allows md-menu to be a secondary element
- Adds aria label to menu triggerer if missing

Fixes angular#3339
devversion added a commit to devversion/material that referenced this issue Feb 1, 2016
- Allow md-menu to be a proxied element in a list
- Smart detection of being right or left aligned
- Allows md-menu to be a secondary element
- Adds aria label to menu triggerer if missing

Fixes angular#3339
devversion added a commit to devversion/material that referenced this issue Feb 2, 2016
- Allow md-menu to be a proxied element in a list
- Smart detection of being right or left aligned
- Allows md-menu to be a secondary element
- Adds aria label to menu triggerer if missing

Fixes angular#3339
devversion added a commit to devversion/material that referenced this issue Feb 2, 2016
- Allow md-menu to be a proxied element in a list
- Smart detection of being right or left aligned
- Allows md-menu to be a secondary element
- Adds aria label to menu triggerer if missing

Fixes angular#3339
@patrykbialek
Copy link

Hi, didn't read entire history of that issue... I need the md-menu as well. I make some temp solution.
There you are:

    // Check for a secondary item and move it outside
    if ( secondaryItem && (
        isMdMenu(secondaryItem) ||
        secondaryItem.hasAttribute('ng-click') ||
        ( tAttrs.ngClick &&
        isProxiedElement(secondaryItem) )
      )) {
      tEl.addClass('md-with-secondary');
      tEl.append(secondaryItem);
    }

  function isMdMenu(el) {
    var nodeName = el.nodeName.toUpperCase();

    return nodeName == "MD-MENU";
  }

@devversion
Copy link
Member

My PR #6459 is already pending.

@devversion devversion self-assigned this Apr 19, 2016
@devversion devversion added the pr: merge ready This PR is ready for a caretaker to review label Apr 19, 2016
@ThomasBurleson ThomasBurleson modified the milestones: Backlog, Deprecated Apr 20, 2016
@devversion devversion modified the milestones: 1.3.0, Deprecated Apr 20, 2016
@ThomasBurleson ThomasBurleson modified the milestones: 1.3.0, Backlog Apr 20, 2016
@ThomasBurleson ThomasBurleson added has: Pull Request A PR has been created to address this issue and removed pr: merge ready This PR is ready for a caretaker to review labels Apr 21, 2016
@crisbeto crisbeto assigned crisbeto and unassigned devversion Apr 21, 2016
@crisbeto crisbeto assigned devversion and unassigned crisbeto May 27, 2016
devversion added a commit to devversion/material that referenced this issue May 27, 2016
- Allow md-menu to be a proxied element in a list
- Smart detection of being right or left aligned
- Allows md-menu to be a secondary element
- Adds aria label to menu triggerer if missing

Fixes angular#3339
devversion added a commit to devversion/material that referenced this issue May 27, 2016
* Allow md-menu to be a proxied element in a list
* Smart detection of being right or left aligned
* Allows md-menu to be a secondary element

* Support for RTL pages, automatically detecting the menu origin.

Fixes angular#3339
@Splaktar Splaktar removed this from the - Backlog milestone Feb 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
has: Pull Request A PR has been created to address this issue P4: minor Minor issues. May not be fixed without community contributions. ux: integration
Projects
None yet
Development

No branches or pull requests