Преглед на файлове

fix issue were auto-animate could interfere with inherited line-height

hakimel преди 2 години
родител
ревизия
b23d15c430
променени са 5 файла, в които са добавени 8 реда и са изтрити 2 реда
  1. 0 0
      dist/reveal.esm.js
  2. 0 0
      dist/reveal.esm.js.map
  3. 0 0
      dist/reveal.js
  4. 0 0
      dist/reveal.js.map
  5. 8 2
      js/controllers/autoanimate.js

Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/reveal.esm.js


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/reveal.esm.js.map


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/reveal.js


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/reveal.js.map


+ 8 - 2
js/controllers/autoanimate.js

@@ -399,7 +399,14 @@ export default class AutoAnimate {
 				value = { value: style.to, explicitValue: true };
 			}
 			else {
-				value = computedStyles[style.property];
+				// Use a unitless value for line-height so that it inherits properly
+				if( style.property === 'line-height' ) {
+					value = parseFloat( computedStyles['line-height'] ) / parseFloat( computedStyles['font-size'] );
+				}
+
+				if( isNaN(value) ) {
+					value = computedStyles[style.property];
+				}
 			}
 
 			if( value !== '' ) {
@@ -475,7 +482,6 @@ export default class AutoAnimate {
 		} );
 
 		pairs.forEach( pair => {
-
 			// Disable scale transformations on text nodes, we transition
 			// each individual text property instead
 			if( matches( pair.from, textNodes ) ) {

Някои файлове не бяха показани, защото твърде много файлове са промени