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

Commit

Permalink
fix(tabs): nested tabs should now work properly when using md-tab-label
Browse files Browse the repository at this point in the history
and md-tab-body

Closes #3206
  • Loading branch information
Robert Messerle committed Jun 11, 2015
1 parent 83a50f2 commit e3e52c2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/tabs/js/tabDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function MdTab () {
return getLabelElement() || getLabelAttribute() || getElementContents();
function getLabelAttribute () { return attr.label; }
function getLabelElement () {
var label = element.find('md-tab-label');
var label = element.find('md-tab-label').eq(0);
if (label.length) return label.remove().html();
}
function getElementContents () {
Expand All @@ -79,7 +79,7 @@ function MdTab () {
}
}
function getTemplate () {
var content = element.find('md-tab-body'),
var content = element.find('md-tab-body').eq(0),
template = content.length ? content.html() : attr.label ? element.html() : '';
if (content.length) content.remove();
else if (attr.label) element.empty();
Expand All @@ -99,8 +99,8 @@ function MdTab () {
if (!ctrl) return;
var tabs = element.parent()[0].getElementsByTagName('md-tab'),
index = Array.prototype.indexOf.call(tabs, element[0]),
body = element.find('md-tab-body').remove(),
label = element.find('md-tab-label').remove(),
body = element.find('md-tab-body').eq(0).remove(),
label = element.find('md-tab-label').eq(0).remove(),
data = ctrl.insertTab({
scope: scope,
parent: scope.$parent,
Expand Down

0 comments on commit e3e52c2

Please sign in to comment.