فهرست منبع

remove need for dedicated data-auto-animate-unmatched attribute

Hakim El Hattab 5 سال پیش
والد
کامیت
4eca625330
3فایلهای تغییر یافته به همراه8 افزوده شده و 12 حذف شده
  1. 2 2
      css/reveal.css
  2. 2 2
      css/reveal.scss
  3. 4 8
      js/reveal.js

+ 2 - 2
css/reveal.css

@@ -1233,10 +1233,10 @@ body {
 /*********************************************
  * AUTO ANIMATE
  *********************************************/
-.reveal section[data-auto-animate] [data-auto-animate-unmatched="fade-in"] {
+.reveal section[data-auto-animate] [data-auto-animate-target="unmatched"] {
   opacity: 0; }
 
-.reveal section[data-auto-animate="running"] [data-auto-animate-unmatched="fade-in"] {
+.reveal section[data-auto-animate="running"] [data-auto-animate-target="unmatched"] {
   opacity: 1; }
 
 /*********************************************

+ 2 - 2
css/reveal.scss

@@ -1318,10 +1318,10 @@ $controlsArrowAngleActive: 36deg;
  * AUTO ANIMATE
  *********************************************/
 
-.reveal section[data-auto-animate] [data-auto-animate-unmatched="fade-in"] {
+.reveal section[data-auto-animate] [data-auto-animate-target="unmatched"] {
 	opacity: 0;
 }
-.reveal section[data-auto-animate="running"] [data-auto-animate-unmatched="fade-in"] {
+.reveal section[data-auto-animate="running"] [data-auto-animate-target="unmatched"] {
 	opacity: 1;
 }
 

+ 4 - 8
js/reveal.js

@@ -3883,10 +3883,10 @@
 			// need to flag them
 			if( toSlide.dataset.autoAnimateUnmatched ) {
 				getUnmatchedAutoAnimateElements( toSlide ).forEach( function( unmatchedElement ) {
-					unmatchedElement.dataset.autoAnimateUnmatched = 'fade-in';
+					unmatchedElement.dataset.autoAnimateTarget = 'unmatched';
 				} );
 
-				css.push( '.reveal [data-auto-animate="running"] [data-auto-animate-unmatched] { transition: all '+ (animationOptions.duration*0.8) +'s ease '+ (animationOptions.duration*0.2) +'s; }' );
+				css.push( '.reveal [data-auto-animate="running"] [data-auto-animate-target="unmatched"] { transition: all '+ (animationOptions.duration*0.8) +'s ease '+ (animationOptions.duration*0.2) +'s; }' );
 			}
 
 			// Setting the whole chunk of CSS at once is the most
@@ -3918,10 +3918,6 @@
 			delete element.dataset.autoAnimateTarget;
 		} );
 
-		toArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR + ':not(.stack) [data-auto-animate-unmatched]' ) ).forEach( function( element ) {
-			delete element.dataset.autoAnimateUnmatched;
-		} );
-
 	}
 
 	/**
@@ -4208,8 +4204,8 @@
 	/**
 	 * Returns a all elements within the given scope that should
 	 * be considered unmatched in an auto-animate transition. If
-	 * fading of unmatched elements is turnded on, these elements
-	 * will fade when going between auto-aniamted slides.
+	 * fading of unmatched elements is turned on, these elements
+	 * will fade when going between auto-animate slides.
 	 *
 	 * Note that parents of auto-animate targets are NOT considerd
 	 * unmatched since fading them would break the auto-animation.