From bd2559a8bcc56e6c1ce5f27f3ff87a7364c3aa76 Mon Sep 17 00:00:00 2001 From: Tony Air Date: Fri, 31 Jul 2020 01:06:57 +0700 Subject: [PATCH] IMPR: Header, sidebar and video preview fixtures --- package.json | 2 +- src/js/_components/_ui.header-footer.js | 18 +++++++----------- src/js/_components/_ui.sidebar.js | 4 ++-- src/js/_components/_ui.video.preview.js | 5 ++++- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 8e9ffee..6cacfdc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@a2nt/ss-bootstrap-ui-webpack-boilerplate", - "version": "2.3.6", + "version": "2.3.7", "author": "Tony Air ", "license": "MIT", "description": "This UI Kit allows you to build Bootstrap 4 webapp with some extra UI features. It's easy to extend and easy to convert HTML templates to CMS templates.", diff --git a/src/js/_components/_ui.header-footer.js b/src/js/_components/_ui.header-footer.js index d3c0a95..03c2618 100644 --- a/src/js/_components/_ui.header-footer.js +++ b/src/js/_components/_ui.header-footer.js @@ -28,9 +28,6 @@ const HeaderUI = (($) => { }; updateHeader(); - $Body.on('scroll resize', () => { - updateHeader(); - }); const updateFooter = (i, el) => { const $el = $(el); @@ -45,14 +42,6 @@ const HeaderUI = (($) => { setTimeout(() => { $('.footer,.jsFooterUI').each(updateFooter); }, 500); - - $Body.on('resize', () => { - $('.footer,.jsFooterUI').css('height', 'auto'); - setTimeout(() => { - $('.footer,.jsFooterUI').each(updateFooter); - }, 500); - }); - } static dispose() { @@ -65,6 +54,13 @@ const HeaderUI = (($) => { HeaderUI.init(); }); + // align event content + $(W).on(`${Events.RESIZE}`, () => { + setTimeout(() => { + HeaderUI.init(); + }, 200); + }); + W.HeaderUI = new HeaderUI(); return HeaderUI; diff --git a/src/js/_components/_ui.sidebar.js b/src/js/_components/_ui.sidebar.js index 4461b93..6bbaa3b 100755 --- a/src/js/_components/_ui.sidebar.js +++ b/src/js/_components/_ui.sidebar.js @@ -53,9 +53,9 @@ const SidebarUI = (($) => { $innerWrapper.attr('style', ''); }else if(scrollPos >= (contentOffset + contentOffsetHeight - $innerWrapper[0].offsetHeight)){ // bottom pos - $innerWrapper.attr('style', `position:absolute;bottom:${fontSize}px`); + $innerWrapper.attr('style', `position:absolute;bottom:${fontSize}px`); }else { - // scrolled pos + // scrolled pos $innerWrapper.attr('style', `position:fixed;top:${fontSize}px;width:${sidebarWidth}px`); } diff --git a/src/js/_components/_ui.video.preview.js b/src/js/_components/_ui.video.preview.js index dc60b36..9160eda 100755 --- a/src/js/_components/_ui.video.preview.js +++ b/src/js/_components/_ui.video.preview.js @@ -22,7 +22,10 @@ const VideoPreviewUI = (($) => { ui.$_el.data(DATA_KEY, this); const href = ui.$_el.attr('href') || ui.$_el.data('href'); const YouTubeGetID = (url) => { - parsedURL = url.split(/(vi\/|v%3D|v=|\/v\/|youtu\.be\/|\/embed\/)/); + const parsedURL = url.split( + /(vi\/|v%3D|v=|\/v\/|youtu\.be\/|\/embed\/)/, + ); + console.log(parsedURL); return undefined !== parsedURL[2] ? parsedURL[2].split(/[^0-9a-z_-]/i)[0] : parsedURL[0];