IMPR: Header, sidebar and video preview fixtures

This commit is contained in:
Tony Air 2020-07-31 01:06:57 +07:00
parent d61dd6a519
commit bd2559a8bc
4 changed files with 14 additions and 15 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@a2nt/ss-bootstrap-ui-webpack-boilerplate",
"version": "2.3.6",
"version": "2.3.7",
"author": "Tony Air <tony@twma.pro>",
"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.",

View File

@ -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;

View File

@ -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`);
}

View File

@ -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];