feat(nav): iOS swipe to go back

Closes #5185
This commit is contained in:
Adam Bradley
2016-02-17 13:35:30 -06:00
parent ae17e7f988
commit da37029195
6 changed files with 226 additions and 235 deletions

View File

@@ -48,21 +48,23 @@ export class Gesture {
}
listen() {
this._hammer = Hammer(this.element, this._options);
if (!this.isListening) {
this._hammer = Hammer(this.element, this._options);
}
this.isListening = true;
}
unlisten() {
var type, i;
if (this._hammer) {
if (this._hammer && this.isListening) {
for (type in this._callbacks) {
for (i = 0; i < this._callbacks[type].length; i++) {
this._hammer.off(type, this._callbacks[type]);
}
}
this._callbacks = {};
this._hammer.destroy();
}
this._callbacks = {};
this.isListening = false;
}