mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
refactor(animations): inline css animations
This commit is contained in:
@@ -30,7 +30,11 @@ import {Toolbar} from '../toolbar/toolbar';
|
||||
*/
|
||||
@Component({
|
||||
selector: 'button:not([ion-item]),[button]',
|
||||
template: '<span class="button-inner"><ng-content></ng-content></span>'
|
||||
template:
|
||||
'<span class="button-inner">' +
|
||||
'<ng-content></ng-content>' +
|
||||
'</span>' +
|
||||
'<ion-button-effect></ion-button-effect>'
|
||||
})
|
||||
export class Button {
|
||||
private _role: string = 'button'; // bar-button/item-button
|
||||
@@ -125,7 +129,7 @@ export class Button {
|
||||
private _readIcon(element: HTMLElement) {
|
||||
// figure out if and where the icon lives in the button
|
||||
let childNodes = element.childNodes;
|
||||
if (childNodes.length == 1) {
|
||||
if (childNodes.length > 0) {
|
||||
childNodes = childNodes[0].childNodes;
|
||||
}
|
||||
let childNode;
|
||||
@@ -158,6 +162,7 @@ export class Button {
|
||||
} else if (nodes[0] === TEXT && nodes[1] === ICON) {
|
||||
this._icon = 'icon-right';
|
||||
}
|
||||
|
||||
} else if (nodes.length === 1 && nodes[0] === ICON) {
|
||||
this._icon = 'icon-only';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user