@@ -332,7 +332,7 @@ function cardString(template, components) {
332332 var headerAsOverlay = hasArt && template && template["overlay"] === true && (hasTitle || hasMascot);
333333 var hasSubtitle = hasTitle && components["subtitle"] || false;
334334 var hasHeaderRow = hasMascot && hasTitle;
335− var hasAttributes = hasTitle && components["attributes"] || false;
335+ var hasAttributes = hasTitle && components["attributes"]["field"] || false;
336336
337337 if (hasBackground) {
338338 code += kBackgroundLoaderCode;
@@ -443,6 +443,7 @@ function cardString(template, components) {
443443
444444 var summaryColorWithBackground = 'backgroundLoader.active && backgroundLoader.item && backgroundLoader.item.luminance < 0.7 ? "white" : (root.scopeStyle ? root.scopeStyle.foreground : "grey")';
445445
446+ var hasTitleContainer = hasTitle && (hasEmblem || (hasMascot && (hasSubtitle || hasAttributes)));
446447 var titleSubtitleCode = '';
447448 if (hasTitle) {
448449 var titleColor;
@@ -480,7 +481,7 @@ function cardString(template, components) {
480481 rightMargin: units.gu(1); \n';
481482 }
482483
483− if (hasEmblem || (hasMascot && (hasSubtitle || hasAttributes))) {
484+ if (hasTitleContainer) {
484485 // Using headerTitleContainer
485486 titleAnchors = titleRightAnchor;
486487 titleAnchors += 'left: parent.left; \n\
@@ -557,7 +558,7 @@ function cardString(template, components) {
557558 containerHeight += ' + attributesRow.height';
558559 }
559560
560− if (hasEmblem || (hasMascot && (hasSubtitle || hasAttributes))) {
561+ if (hasTitleContainer) {
561562 // use container
562563 titleSubtitleCode = kHeaderContainerCodeGenerator(titleContainerAnchors, containerHeight, containerCode);
563564 } else {
@@ -587,7 +588,7 @@ function cardString(template, components) {
587588 if (isHorizontal && hasArt) summaryTopAnchor = 'artShapeHolder.bottom';
588589 else if (headerAsOverlay && hasArt) summaryTopAnchor = 'artShapeHolder.bottom';
589590 else if (hasHeaderRow) summaryTopAnchor = 'row.bottom';
590− else if (hasEmblem || (hasMascot && (hasSubtitle || hasAttributes))) summaryTopAnchor = 'headerTitleContainer.bottom';
591+ else if (hasTitleContainer) summaryTopAnchor = 'headerTitleContainer.bottom';
591592 else if (hasMascot) summaryTopAnchor = 'mascotImage.bottom';
592593 else if (hasAttributes) summaryTopAnchor = 'attributesRow.bottom';
593594 else if (hasSubtitle) summaryTopAnchor = 'subtitleLabel.bottom';
@@ -617,23 +618,26 @@ function cardString(template, components) {
617618 }
618619 code += kTouchdownCode.arg(touchdownAnchors);
619620
621+ var implicitHeight = 'implicitHeight: ';
620622 if (hasSummary) {
621− code += 'implicitHeight: summary.y + summary.height + (summary.text ? units.gu(1) : 0);\n';
623+ implicitHeight += 'summary.y + summary.height + (summary.text ? units.gu(1) : 0);\n';
622624 } else if (hasHeaderRow) {
623− code += 'implicitHeight: row.y + row.height + units.gu(1);\n';
625+ implicitHeight += 'row.y + row.height + units.gu(1);\n';
624626 } else if (hasMascot) {
625− code += 'implicitHeight: mascotImage.y + mascotImage.height;\n';
627+ implicitHeight += 'mascotImage.y + mascotImage.height;\n';
628+ } else if (hasTitleContainer) {
629+ implicitHeight += 'headerTitleContainer.y + headerTitleContainer.height + units.gu(1);\n';
626630 } else if (hasAttributes) {
627− code += 'implicitHeight: attributesRow.y + attributesRow.height + units.gu(1);\n';
631+ implicitHeight += 'attributesRow.y + attributesRow.height + units.gu(1);\n';
628632 } else if (hasSubtitle) {
629− code += 'implicitHeight: subtitleLabel.y + subtitleLabel.height + units.gu(1);\n';
633+ implicitHeight += 'subtitleLabel.y + subtitleLabel.height + units.gu(1);\n';
630634 } else if (hasTitle) {
631− code += 'implicitHeight: titleLabel.y + titleLabel.height + units.gu(1);\n';
635+ implicitHeight += 'titleLabel.y + titleLabel.height + units.gu(1);\n';
632636 } else if (hasArt) {
633− code += 'implicitHeight: artShapeHolder.height;\n';
637+ implicitHeight += 'artShapeHolder.height;\n';
634638 }
635639 // Close the AbstractButton
636− code += '}\n';
640+ code += implicitHeight + '}\n';
637641
638642 return code;
639643}