ag-timemachine
Advanced tools
Comparing version 1.0.87 to 1.0.88
{ | ||
"name": "ag-timemachine", | ||
"version": "1.0.87", | ||
"version": "1.0.88", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -106,15 +106,19 @@ "use strict"; | ||
AgTmPlayer.prototype.nextFrame = function () { | ||
var _this = this; | ||
var next = this.frames.find(function (f) { return f.getTime() > _this.target.getTime(); }); | ||
if (!next) | ||
return; | ||
this.target = next; | ||
for (var i = 0; i < this.frames.length; i++) { | ||
if (this.frames[i].getTime() > this.target.getTime()) { | ||
this.target = this.frames[i]; | ||
return; | ||
} | ||
} | ||
}; | ||
AgTmPlayer.prototype.preFrame = function () { | ||
var _this = this; | ||
var reverse = this.frames.reverse(); | ||
var pre = reverse.findIndex(function (f) { return f.getTime() <= _this.target.getTime(); }); | ||
if (pre < 0) | ||
return; | ||
this.target = reverse.length > pre + 1 ? reverse[pre + 1] : reverse[pre]; | ||
for (var i = this.frames.length - 1; i >= 0; i--) { | ||
if (this.frames[i].getTime() <= this.target.getTime()) { | ||
if (i > 0) | ||
this.target = this.frames[i - 1]; | ||
else | ||
this.target = this.frames[i]; | ||
return; | ||
} | ||
} | ||
}; | ||
@@ -121,0 +125,0 @@ AgTmPlayer.prototype.forward = function () { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
72948
1610