Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f589753

Browse files
committed
fix raf bind in IE9
1 parent edb75c8 commit f589753

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

‎.eslintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"extends": "vue",
33
"rules": {
4-
"no-duplicate-imports": 0
4+
"no-duplicate-imports": 0,
5+
"no-useless-escape": 0
56
}
67
}

‎src/transition/transition.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,20 @@ const animDurationProp = animationProp + 'Duration'
3232
* transitions but not raf (e.g. Android 4.2 browser) - since
3333
* these environments are usually slow, we are giving it a
3434
* relatively large timeout.
35-
*
35+
*
3636
* Binding to window is necessary to make hot reload work in
3737
* IE in strict mode
3838
*/
3939

40-
const raf = inBrowser && window.requestAnimationFrame.bind(window)
41-
const waitForTransitionStart = raf
42-
/* istanbul ignore next */
43-
? function (fn) { raf(function () { raf(fn) }) }
44-
: function (fn) { setTimeout(fn, 50) }
40+
const raf = inBrowser && window.requestAnimationFrame
41+
? window.requestAnimationFrame.bind(window)
42+
: setTimeout
43+
44+
function waitForTransitionStart (fn) {
45+
raf(() => {
46+
raf(fn)
47+
})
48+
}
4549

4650
/**
4751
* A Transition object that encapsulates the state and logic

0 commit comments

Comments
 (0)