]> BookStack Code Mirror - bookstack/blobdiff - resources/js/services/animations.js
Ran eslint fix on existing codebase
[bookstack] / resources / js / services / animations.js
index 12b8077cf7dccec37dc48e6f83a7c6aa1ce43c86..43bd6a0d0c47df3668e950211ba6e67041a7d451 100644 (file)
@@ -15,7 +15,7 @@ export function fadeIn(element, animTime = 400, onComplete = null) {
     cleanupExistingElementAnimation(element);
     element.style.display = 'block';
     animateStyles(element, {
-        opacity: ['0', '1']
+        opacity: ['0', '1'],
     }, animTime, () => {
         if (onComplete) onComplete();
     });
@@ -30,7 +30,7 @@ export function fadeIn(element, animTime = 400, onComplete = null) {
 export function fadeOut(element, animTime = 400, onComplete = null) {
     cleanupExistingElementAnimation(element);
     animateStyles(element, {
-        opacity: ['1', '0']
+        opacity: ['1', '0'],
     }, animTime, () => {
         element.style.display = 'none';
         if (onComplete) onComplete();
@@ -125,12 +125,12 @@ export function transitionHeight(element, animTime = 400) {
  */
 function animateStyles(element, styles, animTime = 400, onComplete = null) {
     const styleNames = Object.keys(styles);
-    for (let style of styleNames) {
+    for (const style of styleNames) {
         element.style[style] = styles[style][0];
     }
 
     const cleanup = () => {
-        for (let style of styleNames) {
+        for (const style of styleNames) {
             element.style[style] = null;
         }
         element.style.transition = null;
@@ -141,7 +141,7 @@ function animateStyles(element, styles, animTime = 400, onComplete = null) {
 
     setTimeout(() => {
         element.style.transition = `all ease-in-out ${animTime}ms`;
-        for (let style of styleNames) {
+        for (const style of styleNames) {
             element.style[style] = styles[style][1];
         }
 
@@ -159,4 +159,4 @@ function cleanupExistingElementAnimation(element) {
         const oldCleanup = animateStylesCleanupMap.get(element);
         oldCleanup();
     }
-}
\ No newline at end of file
+}