From 56496e4f2ac5a03ed79c95bb7d3d23e05c6586ed Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Sat, 5 Dec 2015 21:07:15 -0600 Subject: [PATCH] only apply button class for non item --- ionic/components/button/button.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/ionic/components/button/button.ts b/ionic/components/button/button.ts index e6b04c7e5b..58a710da14 100644 --- a/ionic/components/button/button.ts +++ b/ionic/components/button/button.ts @@ -30,10 +30,7 @@ import {Config} from '../../config/config'; */ @Directive({ - selector: 'button,[button]', - host: { - 'class': 'button' - } + selector: 'button,[button]' }) export class Button { @@ -50,10 +47,12 @@ export class Button { } if (element.hasAttribute('ion-item')) { - // no need to put on these icon classes for an ion-item + // no need to put on these classes for an ion-item return; } + renderer.setElementAttribute(elementRef, 'class', 'button'); + if (type) { renderer.setElementAttribute(elementRef, type, ''); } @@ -85,13 +84,13 @@ export class Button { if (nodes.length > 1) { if (nodes[0] === ICON && nodes[1] === TEXT) { - element.classList.add('icon-left'); + renderer.setElementClass(elementRef, 'icon-left', true); } else if (nodes[0] === TEXT && nodes[1] === ICON) { - element.classList.add('icon-right'); + renderer.setElementClass(elementRef, 'icon-right', true); } } else if (nodes.length === 1 && nodes[0] === ICON) { - element.classList.add('icon-only'); + renderer.setElementClass(elementRef, 'icon-only', true); } }