mirror of
https://github.com/Noratrieb/slides.git
synced 2026-01-14 16:35:07 +01:00
switch old toArray helper to Array.from
This commit is contained in:
parent
6ff4e9306c
commit
2540712714
10 changed files with 111 additions and 113 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { toArray } from '../utils/util.js'
|
||||
import { queryAll } from '../utils/util.js'
|
||||
import { colorToRgb, colorBrightness } from '../utils/color.js'
|
||||
|
||||
/**
|
||||
|
|
@ -39,7 +39,7 @@ export default class Backgrounds {
|
|||
let backgroundStack = this.createBackground( slideh, this.element );
|
||||
|
||||
// Iterate over all vertical slides
|
||||
toArray( slideh.querySelectorAll( 'section' ) ).forEach( slidev => {
|
||||
queryAll( slideh, 'section' ).forEach( slidev => {
|
||||
|
||||
this.createBackground( slidev, backgroundStack );
|
||||
|
||||
|
|
@ -238,7 +238,7 @@ export default class Backgrounds {
|
|||
|
||||
// Update the classes of all backgrounds to match the
|
||||
// states of their slides (past/present/future)
|
||||
toArray( this.element.childNodes ).forEach( ( backgroundh, h ) => {
|
||||
Array.from( this.element.childNodes ).forEach( ( backgroundh, h ) => {
|
||||
|
||||
backgroundh.classList.remove( 'past', 'present', 'future' );
|
||||
|
||||
|
|
@ -256,7 +256,7 @@ export default class Backgrounds {
|
|||
}
|
||||
|
||||
if( includeAll || h === indices.h ) {
|
||||
toArray( backgroundh.querySelectorAll( '.slide-background' ) ).forEach( ( backgroundv, v ) => {
|
||||
queryAll( backgroundh, '.slide-background' ).forEach( ( backgroundv, v ) => {
|
||||
|
||||
backgroundv.classList.remove( 'past', 'present', 'future' );
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue