Skip to content

Commit 8a57786

Browse files
committed
chore(): zone.runOutsideAngular
1 parent f2ad705 commit 8a57786

5 files changed

Lines changed: 22 additions & 11 deletions

File tree

ionic/components/nav/nav.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,6 @@ import {NavController} from './nav-controller';
130130
defaultInputs: {
131131
'swipeBackEnabled': true
132132
},
133-
host: {
134-
'[class.has-views]': '_views.length > 0'
135-
},
136133
template: '<template pane-anchor></template>',
137134
directives: [forwardRef(() => NavPaneAnchor)]
138135
})
@@ -256,6 +253,14 @@ export class Nav extends NavController {
256253
});
257254
}
258255

256+
if (this._views.length === 1) {
257+
this._zone.runOutsideAngular(() => {
258+
// setTimeout(function() {
259+
// componentRef && componentRef.location && componentRef.location.nativeElement.classList.add('has-views');
260+
// }, 100);
261+
});
262+
}
263+
259264
done();
260265
});
261266

ionic/components/slides/swiper-widget.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
===========================*/
2020
export function Swiper(container, params) {
2121

22-
22+
2323
if (!(this instanceof Swiper)) return new Swiper(container, params);
2424

2525
var defaults = {
@@ -987,6 +987,7 @@ export function Swiper(container, params) {
987987

988988
// Attach/detach events
989989
s.initEvents = function (detach) {
990+
console.debug('swiper initEvents', detach ? 'detach' : 'attach');
990991
var actionDom = detach ? 'off' : 'on';
991992
var action = detach ? 'removeEventListener' : 'addEventListener';
992993
var touchEventsTarget = s.params.touchEventsTarget === 'container' ? s.container[0] : s.wrapper[0];

ionic/components/tap-click/activator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class Activator {
4949
clearState() {
5050
// all states should return to normal
5151

52-
if ((!this.app.isEnabled() || this.app.isTransitioning()) && this.clearAttempt < 30) {
52+
if ((!this.app.isEnabled() || this.app.isTransitioning()) && this.clearAttempt < 100) {
5353
// the app is actively disabled, so don't bother deactivating anything.
5454
// this makes it easier on the GPU so it doesn't have to redraw any
5555
// buttons during a transition. This will retry in XX milliseconds.

ionic/gestures/hammer.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ function ifUndefined(val1, val2) {
165165
*/
166166
function addEventListeners(target, types, handler) {
167167
each(splitStr(types), function(type) {
168+
console.debug('hammer addEventListener', type, target.tagName);
168169
target.addEventListener(type, handler, false);
169170
});
170171
}
@@ -177,6 +178,7 @@ function addEventListeners(target, types, handler) {
177178
*/
178179
function removeEventListeners(target, types, handler) {
179180
each(splitStr(types), function(type) {
181+
console.debug('hammer removeEventListener', type, target.tagName);
180182
target.removeEventListener(type, handler, false);
181183
});
182184
}
@@ -392,6 +394,7 @@ Input.prototype = {
392394
* bind the events
393395
*/
394396
init: function() {
397+
console.debug('hammer Input init')
395398
this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);
396399
this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);
397400
this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);

ionic/util/keyboard.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,15 @@ export class IonicKeyboard {
107107
function enableKeyInput() {
108108
cssClass();
109109

110-
document.removeEventListener('mousedown', pointerDown);
111-
document.removeEventListener('touchstart', pointerDown);
110+
this.zone.runOutsideAngular(() => {
111+
document.removeEventListener('mousedown', pointerDown);
112+
document.removeEventListener('touchstart', pointerDown);
112113

113-
if (isKeyInputEnabled) {
114-
document.addEventListener('mousedown', pointerDown);
115-
document.addEventListener('touchstart', pointerDown);
116-
}
114+
if (isKeyInputEnabled) {
115+
document.addEventListener('mousedown', pointerDown);
116+
document.addEventListener('touchstart', pointerDown);
117+
}
118+
});
117119
}
118120

119121
document.addEventListener('keydown', keyDown);

0 commit comments

Comments
 (0)