@egjs/axes
Version:
A module used to change the information of user action entered by various input devices such as touch screen or mouse into the logical virtual coordinates. You can easily create a UI that responds to user actions.
25 lines (21 loc) • 673 B
text/typescript
/*
* Copyright (c) 2015 NAVER Corp.
* egjs projects are licensed under the MIT license
*/
import { AxesOption } from "./Axes";
export class InterruptManager {
private _prevented = false; // check whether the animation event was prevented
public constructor(private _options: AxesOption) {}
public isInterrupting() {
// when interruptable is 'true', return value is always 'true'.
return this._options.interruptable || this._prevented;
}
public isInterrupted() {
return !this._options.interruptable && this._prevented;
}
public setInterrupt(prevented) {
if (!this._options.interruptable) {
this._prevented = prevented;
}
}
}