Skip to content

Commit

Permalink
perf(toggle): toggle’s button is not activated
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Apr 7, 2017
1 parent ea8213b commit 17c0543
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/toggle/toggle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const TOGGLE_VALUE_ACCESSOR: any = {
'[attr.aria-checked]="_value" ' +
'[attr.aria-labelledby]="_labelId" ' +
'[attr.aria-disabled]="_disabled" ' +
'class="item-cover">' +
'class="item-cover" disable-activated>' +
'</button>',
host: {
'[class.toggle-disabled]': '_disabled'
Expand Down
5 changes: 5 additions & 0 deletions src/tap-click/activator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import { PointerCoordinates } from '../util/dom';


export class Activator implements ActivatorBase {

protected _queue: HTMLElement[] = [];
protected _active: HTMLElement[] = [];
protected _activeDefer: Function;
protected _clearDefer: Function;

_css: string;
activatedDelay = ADD_ACTIVATED_DEFERS;
clearDelay = CLEAR_STATE_DEFERS;
Expand All @@ -19,6 +21,9 @@ export class Activator implements ActivatorBase {
}

clickAction(ev: UIEvent, activatableEle: HTMLElement, startCoord: PointerCoordinates) {
if (isActivatedDisabled(ev, activatableEle)) {
return;
}
// a click happened, so immediately deactive all activated elements
this._scheduleClear();

Expand Down
3 changes: 2 additions & 1 deletion src/tap-click/tap-click.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { UIEventManager } from '../gestures/ui-event-manager';
*/
@Injectable()
export class TapClick {

private disableClick: number = 0;
private usePolyfill: boolean;
private activator: ActivatorBase;
Expand Down Expand Up @@ -236,7 +237,7 @@ function getActivatableTarget(ele: HTMLElement): any {
/**
* @hidden
*/
export const isActivatable = function (ele: HTMLElement) {
export function isActivatable(ele: HTMLElement) {
if (ACTIVATABLE_ELEMENTS.indexOf(ele.tagName) > -1) {
return true;
}
Expand Down

0 comments on commit 17c0543

Please sign in to comment.