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

Commit

Permalink
fix(list): wrapping secondary if it has ng-click
Browse files Browse the repository at this point in the history
Secondary was being wrapped only if `md-checkbox` or `md-switch` were near by or `ng-click` was applied on the list item.

fixes #3928

Closes #5993
  • Loading branch information
EladBezalel authored and ThomasBurleson committed Dec 2, 2015
1 parent 19a32d0 commit 358fd98
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/list/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ function mdListItemDirective($mdAria, $mdConstant, $mdUtil, $timeout) {
tEl.addClass('md-no-proxy');
}
}
wrapSecondary();
setupToggleAria();


Expand Down Expand Up @@ -142,7 +143,9 @@ function mdListItemDirective($mdAria, $mdConstant, $mdUtil, $timeout) {

tEl[0].setAttribute('tabindex', '-1');
tEl.append(container);
}

function wrapSecondary() {
if (secondaryItem && !isButton(secondaryItem) && secondaryItem.hasAttribute('ng-click')) {
$mdAria.expect(secondaryItem, 'aria-label');
var buttonWrapper = angular.element('<md-button class="md-secondary-container md-icon-button">');
Expand All @@ -155,10 +158,10 @@ function mdListItemDirective($mdAria, $mdConstant, $mdUtil, $timeout) {

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

0 comments on commit 358fd98

Please sign in to comment.