Fix chatlist search horizontal menu
Fix sticky horizontal menu in shared media
This commit is contained in:
parent
158a242193
commit
d434df8a3b
@ -167,7 +167,7 @@ export default class AppSearchSuper {
|
|||||||
}, () => {
|
}, () => {
|
||||||
this.scrollable.onScroll();
|
this.scrollable.onScroll();
|
||||||
this.onTransitionEnd();
|
this.onTransitionEnd();
|
||||||
});
|
}, undefined, navScrollable);
|
||||||
|
|
||||||
this.tabs.inputMessagesFilterPhotoVideo.addEventListener('click', (e) => {
|
this.tabs.inputMessagesFilterPhotoVideo.addEventListener('click', (e) => {
|
||||||
const target = findUpClassName(e.target as HTMLDivElement, 'grid-item');
|
const target = findUpClassName(e.target as HTMLDivElement, 'grid-item');
|
||||||
|
@ -343,6 +343,10 @@ export class EmoticonsDropdown {
|
|||||||
|
|
||||||
const which = whichChild(target);
|
const which = whichChild(target);
|
||||||
|
|
||||||
|
/* if(menuScroll) {
|
||||||
|
menuScroll.scrollIntoView(target, false, 0);
|
||||||
|
} */
|
||||||
|
|
||||||
if(!setActive(which)) {
|
if(!setActive(which)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import { findUpTag, whichChild } from "../helpers/dom";
|
import { findUpTag, whichChild } from "../helpers/dom";
|
||||||
import { TransitionSlider } from "./transition";
|
import { TransitionSlider } from "./transition";
|
||||||
|
import { ScrollableX } from "./scrollable";
|
||||||
|
|
||||||
export function horizontalMenu(tabs: HTMLElement, content: HTMLElement, onClick?: (id: number, tabContent: HTMLDivElement) => void, onTransitionEnd?: () => void, transitionTime = 250) {
|
export function horizontalMenu(tabs: HTMLElement, content: HTMLElement, onClick?: (id: number, tabContent: HTMLDivElement) => void, onTransitionEnd?: () => void, transitionTime = 250, scrollableX?: ScrollableX) {
|
||||||
const selectTab = TransitionSlider(content, tabs || content.dataset.slider == 'tabs' ? 'tabs' : 'navigation', transitionTime, onTransitionEnd);
|
const selectTab = TransitionSlider(content, tabs || content.dataset.slider == 'tabs' ? 'tabs' : 'navigation', transitionTime, onTransitionEnd);
|
||||||
|
|
||||||
if(tabs) {
|
if(tabs) {
|
||||||
@ -19,6 +20,11 @@ export function horizontalMenu(tabs: HTMLElement, content: HTMLElement, onClick?
|
|||||||
const tabContent = content.children[id] as HTMLDivElement;
|
const tabContent = content.children[id] as HTMLDivElement;
|
||||||
|
|
||||||
if(onClick) onClick(id, tabContent);
|
if(onClick) onClick(id, tabContent);
|
||||||
|
|
||||||
|
if(scrollableX) {
|
||||||
|
scrollableX.scrollIntoView(target.parentElement.children[id] as HTMLElement, true, transitionTime);
|
||||||
|
}
|
||||||
|
|
||||||
if(target.classList.contains('active') || id === selectTab.prevId) {
|
if(target.classList.contains('active') || id === selectTab.prevId) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -190,6 +190,7 @@ export class AppSidebarLeft extends SidebarSlider {
|
|||||||
name: 'Voice'
|
name: 'Voice'
|
||||||
}], scrollable, this.searchGroups, true);
|
}], scrollable, this.searchGroups, true);
|
||||||
|
|
||||||
|
searchContainer.prepend(searchSuper.nav.parentElement.parentElement);
|
||||||
scrollable.container.append(searchSuper.container);
|
scrollable.container.append(searchSuper.container);
|
||||||
|
|
||||||
const resetSearch = () => {
|
const resetSearch = () => {
|
||||||
|
@ -432,8 +432,6 @@ export class AppDialogsManager {
|
|||||||
id += 1;
|
id += 1;
|
||||||
} */
|
} */
|
||||||
|
|
||||||
foldersScrollable.scrollIntoView(this.folders.menu.firstElementChild.children[id] as HTMLElement, true, 250);
|
|
||||||
|
|
||||||
id = +tabContent.dataset.filterId || 0;
|
id = +tabContent.dataset.filterId || 0;
|
||||||
|
|
||||||
if(this.filterId == id) return;
|
if(this.filterId == id) return;
|
||||||
@ -448,7 +446,7 @@ export class AppDialogsManager {
|
|||||||
this.chatLists[folderId].innerHTML = '';
|
this.chatLists[folderId].innerHTML = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}, undefined, foldersScrollable);
|
||||||
|
|
||||||
//selectTab(0);
|
//selectTab(0);
|
||||||
(this.folders.menu.firstElementChild.firstElementChild as HTMLElement).click();
|
(this.folders.menu.firstElementChild.firstElementChild as HTMLElement).click();
|
||||||
|
@ -163,12 +163,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.search-super-tabs-scrollable {
|
.search-super-tabs-scrollable {
|
||||||
position: sticky;
|
position: relative !important;
|
||||||
top: 0;
|
|
||||||
z-index: 2;
|
|
||||||
|
|
||||||
.menu-horizontal ul {
|
.menu-horizontal li {
|
||||||
justify-content: space-around;
|
flex: 1 0 auto !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -272,12 +272,6 @@
|
|||||||
|
|
||||||
&-tabs {
|
&-tabs {
|
||||||
//margin-top: 36px;
|
//margin-top: 36px;
|
||||||
position: -webkit-sticky !important;
|
|
||||||
position: sticky !important;
|
|
||||||
top: 0;
|
|
||||||
z-index: 2;
|
|
||||||
background-color: #fff;
|
|
||||||
|
|
||||||
i {
|
i {
|
||||||
padding-right: 1.5rem !important;
|
padding-right: 1.5rem !important;
|
||||||
margin-left: -.75rem !important;
|
margin-left: -.75rem !important;
|
||||||
@ -286,6 +280,11 @@
|
|||||||
|
|
||||||
&-tabs-scrollable {
|
&-tabs-scrollable {
|
||||||
box-shadow: none !important;
|
box-shadow: none !important;
|
||||||
|
position: -webkit-sticky !important;
|
||||||
|
position: sticky !important;
|
||||||
|
top: 0;
|
||||||
|
z-index: 2;
|
||||||
|
background-color: #fff;
|
||||||
|
|
||||||
.scrollable {
|
.scrollable {
|
||||||
position: relative;
|
position: relative;
|
||||||
@ -506,9 +505,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&-content-music, &-content-voice {
|
&-content-music, &-content-voice {
|
||||||
|
|
||||||
.search-super-month-items {
|
.search-super-month-items {
|
||||||
padding: 20px 15px 0px 20px;
|
padding: 20px 15px 0px 20px;
|
||||||
|
Loading…
Reference in New Issue
Block a user