Evan You пре 9 година
родитељ
комит
f5897533f5
2 измењених фајлова са 12 додато и 7 уклоњено
  1. 2 1
      .eslintrc
  2. 10 6
      src/transition/transition.js

+ 2 - 1
.eslintrc

@@ -1,6 +1,7 @@
 {
   "extends": "vue",
   "rules": {
-    "no-duplicate-imports": 0
+    "no-duplicate-imports": 0,
+    "no-useless-escape": 0
   }
 }

+ 10 - 6
src/transition/transition.js

@@ -32,16 +32,20 @@ const animDurationProp = animationProp + 'Duration'
  * transitions but not raf (e.g. Android 4.2 browser) - since
  * these environments are usually slow, we are giving it a
  * relatively large timeout.
- * 
+ *
  * Binding to window is necessary to make hot reload work in
  * IE in strict mode
  */
 
-const raf = inBrowser && window.requestAnimationFrame.bind(window)
-const waitForTransitionStart = raf
-  /* istanbul ignore next */
-  ? function (fn) { raf(function () { raf(fn) }) }
-  : function (fn) { setTimeout(fn, 50) }
+const raf = inBrowser && window.requestAnimationFrame
+  ? window.requestAnimationFrame.bind(window)
+  : setTimeout
+
+function waitForTransitionStart (fn) {
+  raf(() => {
+    raf(fn)
+  })
+}
 
 /**
  * A Transition object that encapsulates the state and logic