-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
kaptinlin
committed
Oct 17, 2016
1 parent
2e08ab8
commit 6851454
Showing
14 changed files
with
91 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export default { | ||
version:'0.4.3' | ||
version:'0.4.4' | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
export function getTime() { | ||
if (typeof window.performance !== 'undefined' && window.performance.now) { | ||
return window.performance.now(); | ||
} | ||
return Date.now(); | ||
} | ||
|
||
export function isPercentage(n) { | ||
return typeof n === 'string' && n.indexOf('%') !== -1; | ||
} | ||
|
||
export function conventToPercentage(n) { | ||
if (n < 0) { | ||
n = 0; | ||
} else if (n > 1) { | ||
n = 1; | ||
} | ||
return `${parseFloat(n).toFixed(4) * 100}%`; | ||
} | ||
|
||
export function convertPercentageToFloat(n) { | ||
return parseFloat(n.slice(0, -1) / 100, 10); | ||
} | ||
|
||
export let isFFLionScrollbar = (() => { | ||
'use strict'; | ||
|
||
let isOSXFF, ua, version; | ||
ua = window.navigator.userAgent; | ||
isOSXFF = /(?=.+Mac OS X)(?=.+Firefox)/.test(ua); | ||
if (!isOSXFF) { | ||
return false; | ||
} | ||
version = /Firefox\/\d{2}\./.exec(ua); | ||
if (version) { | ||
version = version[0].replace(/\D+/g, ''); | ||
} | ||
return isOSXFF && +version > 23; | ||
})(); |