diff options
Diffstat (limited to 'src/js/utils')
| -rw-r--r-- | src/js/utils/elements.js | 7 | ||||
| -rw-r--r-- | src/js/utils/style.js | 11 | 
2 files changed, 4 insertions, 14 deletions
| diff --git a/src/js/utils/elements.js b/src/js/utils/elements.js index 98b44f13..4f10938e 100644 --- a/src/js/utils/elements.js +++ b/src/js/utils/elements.js @@ -192,11 +192,8 @@ export function toggleHidden(element, hidden) {          hide = !element.hidden;      } -    if (hide) { -        element.setAttribute('hidden', ''); -    } else { -        element.removeAttribute('hidden'); -    } +    // eslint-disable-next-line no-param-reassign +    element.hidden = hide;  }  // Mirror Element.classList.toggle, with IE compatibility for "force" argument diff --git a/src/js/utils/style.js b/src/js/utils/style.js index 6f3069c9..941db8f2 100644 --- a/src/js/utils/style.js +++ b/src/js/utils/style.js @@ -27,15 +27,8 @@ export function reduceAspectRatio(ratio) {  }  export function getAspectRatio(input) { -    const parse = ratio => { -        if (!validateRatio(ratio)) { -            return null; -        } - -        return ratio.split(':').map(Number); -    }; - -    // Provided ratio +    const parse = ratio => (validateRatio(ratio) ? ratio.split(':').map(Number) : null); +    // Try provided ratio      let ratio = parse(input);      // Get from config | 
