mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
@@ -3,7 +3,6 @@ import { Directive, ElementRef, Input } from '@angular/core';
|
||||
import { AppRoot } from '../app/app';
|
||||
import { isTrueProperty } from '../../util/util';
|
||||
|
||||
const DISABLE_SCROLL = 'disable-scroll';
|
||||
|
||||
/**
|
||||
* @private
|
||||
|
||||
@@ -226,7 +226,10 @@ export class Button {
|
||||
* @private
|
||||
*/
|
||||
setRole(val: string) {
|
||||
this._assignCss(false);
|
||||
this._role = val;
|
||||
this._readIcon(this._elementRef.nativeElement);
|
||||
this._assignCss(true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -350,16 +353,6 @@ export class Button {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
static setRoles(contentButtonChildren: any, role: string) {
|
||||
let buttons = contentButtonChildren.toArray();
|
||||
buttons.forEach((button: any) => {
|
||||
button.setRole(role);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const BUTTON_SIZE_ATTRS = ['large', 'small', 'default'];
|
||||
|
||||
@@ -16,6 +16,7 @@ class E2EPage {
|
||||
myColor1: string;
|
||||
myColor2: string;
|
||||
multiColor: Array<string>;
|
||||
showIf: boolean = true;
|
||||
|
||||
constructor() {
|
||||
this.reset();
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
<ion-toolbar>
|
||||
<ion-buttons start>
|
||||
<button danger *ngIf="showIf">ngIf</button>
|
||||
<button [color]="isDestructive ? 'danger' : 'primary'" [outline]="isOutline">Outline</button>
|
||||
</ion-buttons>
|
||||
<ion-title>Default Buttons</ion-title>
|
||||
@@ -25,6 +26,8 @@
|
||||
<button block [color]="multiColor" [outline]="isClicked" [round]="isCustom" (click)="toggle()">Multicolor Outline (Toggle)</button>
|
||||
<button block [color]="multiColor" [clear]="isClicked" [round]="isCustom" (click)="toggle()">Multicolor Clear (Toggle)</button>
|
||||
<hr/>
|
||||
<button block outline danger (click)="showIf = !showIf">Toggle Header</button>
|
||||
<hr/>
|
||||
<button block outline danger (click)="unify()" class="e2eButtonDynamicUnify">Unify all buttons</button>
|
||||
<button block clear danger (click)="reset()">Reset all buttons</button>
|
||||
|
||||
|
||||
@@ -27,7 +27,9 @@ export class ToolbarItem {
|
||||
@ContentChildren(Button)
|
||||
set _buttons(buttons: any) {
|
||||
if (this.inToolbar) {
|
||||
Button.setRoles(buttons, 'bar-button');
|
||||
buttons.forEach((button: Button) => {
|
||||
button.setRole('bar-button');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user