mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
perf(itemSliding): improve performance
This commit is contained in:
@@ -35,7 +35,10 @@ export class Gesture {
|
||||
}
|
||||
this.hammertime.on(type, cb);
|
||||
(this._callbacks[type] || (this._callbacks[type] = [])).push(cb);
|
||||
//this.element.addEventListener(type, cb);
|
||||
}
|
||||
|
||||
off(type, cb) {
|
||||
this.hammertime.off(type, this._callbacks[type] ? cb : null);
|
||||
}
|
||||
|
||||
listen() {
|
||||
@@ -46,7 +49,6 @@ export class Gesture {
|
||||
if (this.hammertime) {
|
||||
for (let type in this._callbacks) {
|
||||
for (let i = 0; i < this._callbacks[type].length; i++) {
|
||||
//this.element.removeEventListener(type, this._callbacks[type][i]);
|
||||
this.hammertime.off(type, this._callbacks[type]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user