Parcourir la source

added some clear comments

Muzaffer Dede il y a 5 ans
Parent
commit
4cd7590991
1 fichiers modifiés avec 3 ajouts et 2 suppressions
  1. 3 2
      src/directives/show.js

+ 3 - 2
src/directives/show.js

@@ -1,7 +1,7 @@
 import { transitionIn, transitionOut } from '../utils'
 
 export function handleShowDirective(component, el, value, modifiers, initialUpdate = false) {
-    // Resolve any previous pending transitions before starting a new one
+    // if value is changed resolve any previous pending transitions before starting a new one
     if (el.__x_transition_remaining && el.__x_transition_last_value !== value) {
         el.__x_transition_remaining()
     }
@@ -31,7 +31,8 @@ export function handleShowDirective(component, el, value, modifiers, initialUpda
         if (! value) {
             if ( el.style.display !== 'none' ) {
                 transitionOut(el, () => {
-                    // If previous transitions still there, don't use resolve
+                    // If there is a remaning transition
+                    // and value is changed, don't use resolve
                     if ( el.__x_transition_remaining ) {
                         hide()
                     } else {