Prettier for JS
This commit is contained in:
		
							
								
								
									
										12
									
								
								index.js
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								index.js
									
									
									
									
									
								
							@@ -100,7 +100,7 @@ const setVideoSize = (gallery) => {
 | 
				
			|||||||
const hide = async (duration = 500, easing = 'linear') => {
 | 
					const hide = async (duration = 500, easing = 'linear') => {
 | 
				
			||||||
    const gallery = document.body.querySelector('.advdominion-lg');
 | 
					    const gallery = document.body.querySelector('.advdominion-lg');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    await gallery.animate([{opacity: 1}, {opacity: 0}], {
 | 
					    await gallery.animate([{ opacity: 1 }, { opacity: 0 }], {
 | 
				
			||||||
        duration,
 | 
					        duration,
 | 
				
			||||||
        easing,
 | 
					        easing,
 | 
				
			||||||
    }).finished;
 | 
					    }).finished;
 | 
				
			||||||
@@ -121,14 +121,14 @@ const show = async (duration = 500, easing = 'linear') => {
 | 
				
			|||||||
        margin-right: ${getScrollbarWidth()}px
 | 
					        margin-right: ${getScrollbarWidth()}px
 | 
				
			||||||
    `;
 | 
					    `;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    await gallery.animate([{opacity: 0}, {opacity: 1}], {
 | 
					    await gallery.animate([{ opacity: 0 }, { opacity: 1 }], {
 | 
				
			||||||
        duration,
 | 
					        duration,
 | 
				
			||||||
        easing,
 | 
					        easing,
 | 
				
			||||||
    }).finished;
 | 
					    }).finished;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const init = async (items = [], options = {}, index = 0) => {
 | 
					const init = async (items = [], options = {}, index = 0) => {
 | 
				
			||||||
    const {Swiper, Navigation, Pagination} = await import('swiper');
 | 
					    const { Swiper, Navigation, Pagination } = await import('swiper');
 | 
				
			||||||
    Swiper.use([Navigation, Pagination]);
 | 
					    Swiper.use([Navigation, Pagination]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const isVideoInGallery = {
 | 
					    const isVideoInGallery = {
 | 
				
			||||||
@@ -242,7 +242,7 @@ const init = async (items = [], options = {}, index = 0) => {
 | 
				
			|||||||
                    ${options.navigation || ''}
 | 
					                    ${options.navigation || ''}
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
        `
 | 
					        `,
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const gallery = document.body.querySelector('.advdominion-lg');
 | 
					    const gallery = document.body.querySelector('.advdominion-lg');
 | 
				
			||||||
@@ -255,7 +255,7 @@ const init = async (items = [], options = {}, index = 0) => {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    const swiper = new Swiper(
 | 
					    const swiper = new Swiper(
 | 
				
			||||||
        gallery.querySelector('.advdominion-lg__container'),
 | 
					        gallery.querySelector('.advdominion-lg__container'),
 | 
				
			||||||
        Object.assign({init: false, initialSlide: index}, options.swiper)
 | 
					        Object.assign({ init: false, initialSlide: index }, options.swiper),
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    swiper.on('init', function () {
 | 
					    swiper.on('init', function () {
 | 
				
			||||||
@@ -302,7 +302,7 @@ const init = async (items = [], options = {}, index = 0) => {
 | 
				
			|||||||
        },
 | 
					        },
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            once: true,
 | 
					            once: true,
 | 
				
			||||||
        }
 | 
					        },
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user