Skip to content

Commit

Permalink
fix safari12 without "." for performance.now()
Browse files Browse the repository at this point in the history
  • Loading branch information
genify committed Sep 28, 2018
1 parent 4aa9f07 commit fee7e06
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
0.5.1
--------------------------------------------------------
- BUG修复模块
* 修正 util/ajax/rest 无法发送 null 的问题
* 修正 util/ajax/rest 无法发送 null 数据的问题
* 修正 util/animation/animation 在 safari12 中当前时间异常 bug

0.5.0 (2018-06-22)
--------------------------------------------------------
Expand Down
7 changes: 6 additions & 1 deletion src/util/animation/animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,14 @@ NEJ.define([
*/
_pro.__onAnimationFrame = function(_time){
if (!this.__begin) return;
if ((''+_time).indexOf('.')>=0){
// fix safari12 without "." for performance.now()
var ts = ''+Math.floor(_time);
if (ts.length<13){
_time = +new Date;
}
// if ((''+_time).indexOf('.')>=0){
// _time = +new Date;
// }
if (this.__doAnimationFrame(_time)){
this._$stop();
return;
Expand Down

0 comments on commit fee7e06

Please sign in to comment.