Skip to content

Commit

Permalink
style(all): minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Nov 20, 2016
1 parent c002b36 commit 6f96ede
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/components/tap-click/tap-click.ts
Expand Up @@ -3,6 +3,7 @@ import { Injectable, NgZone } from '@angular/core';
import { Activator } from './activator';
import { App } from '../app/app';
import { Config } from '../../config/config';
import { assert } from '../../util/util';
import { hasPointerMoved, pointerCoord } from '../../util/dom';
import { RippleActivator } from './ripple';
import { UIEventManager, PointerEvents, PointerEventType } from '../../util/ui-event-manager';
Expand Down Expand Up @@ -72,7 +73,7 @@ export class TapClick {
if (!this.startCoord) {
return;
}
if (type === PointerEventType.TOUCH && this.usePolyfill && this.app.isEnabled()) {
if (this.usePolyfill && type === PointerEventType.TOUCH && this.app.isEnabled()) {
this.handleTapPolyfill(ev);
}
if (this.activator) {
Expand Down Expand Up @@ -109,6 +110,7 @@ export class TapClick {
}

handleTapPolyfill(ev: any) {
assert(this.usePolyfill, 'this code should not be used if tapPolyfill is disabled');
// only dispatch mouse click events from a touchend event
// when tapPolyfill config is true, and the startCoordand endCoord
// are not too far off from each other
Expand Down
5 changes: 4 additions & 1 deletion src/platform/platform-registry.ts
Expand Up @@ -106,7 +106,7 @@ export const PLATFORM_CONFIGS: {[key: string]: PlatformConfig} = {
keyboardHeight: 300,
mode: 'ios',
scrollAssist: isIOS,
statusbarPadding: !!((<any>window).cordova),
statusbarPadding: isCordova,
swipeBackEnabled: isIOS,
swipeBackThreshold: 40,
tapPolyfill: isIOSUI,
Expand Down Expand Up @@ -218,6 +218,9 @@ export const PLATFORM_CONFIGS: {[key: string]: PlatformConfig} = {
}
};

function isCordova(): boolean {
return !!((<any>window).cordova);
}

function isIOS(p: Platform): boolean {
// shortcut function to be reused internally
Expand Down
4 changes: 1 addition & 3 deletions src/util/util.ts
Expand Up @@ -140,9 +140,7 @@ export const isCheckedProperty = function(a: any, b: any): boolean {
}

// not using strict comparison on purpose
/* tslint:disable */
return (a == b);
/* tslint:enable */
return (a == b); // tslint:disable-line
};


Expand Down

0 comments on commit 6f96ede

Please sign in to comment.