Evan You %!s(int64=12) %!d(string=hai) anos
pai
achega
23c98cb505
Modificáronse 2 ficheiros con 12 adicións e 3 borrados
  1. 1 1
      README.md
  2. 11 2
      src/transition.js

+ 1 - 1
README.md

@@ -18,7 +18,7 @@ Modern, lightweight JavaScript MVVM
 
 - Most Webkit/Blink-based browsers
 - Firefox 4+
-- IE9+ (IE9 needs [classList polyfill](https://github.com/remy/polyfills/blob/master/classList.js))
+- IE9+ (IE9 needs [classList polyfill](https://github.com/remy/polyfills/blob/master/classList.js) and doesn't support transitions)
 
 ## Installation
 

+ 11 - 2
src/transition.js

@@ -9,6 +9,8 @@ var config   = require('./config'),
  */
 module.exports = function (el, stage, changeState, init) {
 
+    // TODO: directly return if IE9
+
     var className = el.sd_transition
 
     // in sd-repeat, the sd-transition directive
@@ -18,9 +20,12 @@ module.exports = function (el, stage, changeState, init) {
     }
 
     // TODO: optional duration which
-    // can override the default transitionend event
+    //       can override the default transitionend event
 
-    // if no transition, just
+    // if no transition, just call changeState sync.
+    // this is internal API and the changeState callback
+    // will always contain only dom manipulations that
+    // doesn't care about the sync/async-ness of this method.
     if (init || !className) {
         return changeState()
     }
@@ -28,14 +33,18 @@ module.exports = function (el, stage, changeState, init) {
     var cl = el.classList
 
     if (stage > 0) { // enter
+
         cl.add(className)
         changeState()
         setTimeout(function () {
             cl.remove(className)
         }, 0)
+
     } else { // leave
+
         cl.add(className)
         el.addEventListener(endEvent, onEnd)
+        
     }
 
     function onEnd () {