mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 03:18:19 -07:00
refresh people on demand, when needed
This commit is contained in:
parent
93ebd18a5c
commit
5722b968dd
@ -197,6 +197,10 @@
|
||||
|
||||
function initSelectionBar(tabs) {
|
||||
|
||||
if (!browser.animate) {
|
||||
return;
|
||||
}
|
||||
|
||||
var contentScrollSlider = tabs.querySelector('.emby-tabs-slider');
|
||||
|
||||
if (!contentScrollSlider) {
|
||||
@ -285,7 +289,7 @@
|
||||
}
|
||||
};
|
||||
|
||||
EmbyTabs.triggerTabChange = function (selected) {
|
||||
EmbyTabs.triggerBeforeTabChange = function (selected) {
|
||||
|
||||
var tabs = this;
|
||||
|
||||
@ -294,6 +298,11 @@
|
||||
selectedTabIndex: tabs.selectedIndex()
|
||||
}
|
||||
}));
|
||||
};
|
||||
|
||||
EmbyTabs.triggerTabChange = function (selected) {
|
||||
|
||||
var tabs = this;
|
||||
|
||||
tabs.dispatchEvent(new CustomEvent("tabchange", {
|
||||
detail: {
|
||||
|
@ -152,16 +152,22 @@
|
||||
LibraryBrowser.configureSwipeTabs(ownerpage, tabs);
|
||||
}
|
||||
|
||||
ownerpage.addEventListener('viewshow', LibraryBrowser.onTabbedpagebeforeshow);
|
||||
|
||||
tabs.addEventListener('beforetabchange', function(e) {
|
||||
if (e.detail.previousIndex != null) {
|
||||
panels[e.detail.previousIndex].classList.remove('is-active');
|
||||
ownerpage.addEventListener('viewbeforeshow', function () {
|
||||
if (tabs.triggerBeforeTabChange) {
|
||||
tabs.triggerBeforeTabChange();
|
||||
}
|
||||
});
|
||||
|
||||
ownerpage.addEventListener('viewshow', function () {
|
||||
tabs.triggerTabChange();
|
||||
});
|
||||
|
||||
tabs.addEventListener('beforetabchange', function (e) {
|
||||
|
||||
if (e.detail.previousIndex != null) {
|
||||
panels[e.detail.previousIndex].classList.remove('is-active');
|
||||
}
|
||||
|
||||
var newPanel = panels[e.detail.selectedTabIndex];
|
||||
|
||||
if (e.detail.previousIndex != null && e.detail.previousIndex != e.detail.selectedTabIndex) {
|
||||
@ -174,38 +180,6 @@
|
||||
});
|
||||
},
|
||||
|
||||
onTabbedpagebeforeshow: function (e) {
|
||||
|
||||
var page = e.target;
|
||||
var delay = 0;
|
||||
|
||||
var pageTabsContainer = page.querySelector('.libraryViewNav');
|
||||
if (!pageTabsContainer || !pageTabsContainer.triggerTabChange) {
|
||||
delay = 300;
|
||||
}
|
||||
|
||||
if (delay) {
|
||||
setTimeout(function () {
|
||||
|
||||
LibraryBrowser.onTabbedpagebeforeshowInternal(page, e);
|
||||
}, delay);
|
||||
} else {
|
||||
LibraryBrowser.onTabbedpagebeforeshowInternal(page, e);
|
||||
}
|
||||
},
|
||||
|
||||
onTabbedpagebeforeshowInternal: function (page, e) {
|
||||
|
||||
var pageTabsContainer = page.querySelector('.libraryViewNav');
|
||||
|
||||
// Go back to the first tab
|
||||
if (!e.detail.isRestored) {
|
||||
pageTabsContainer.selectedIndex(0);
|
||||
return;
|
||||
}
|
||||
pageTabsContainer.triggerTabChange();
|
||||
},
|
||||
|
||||
showTab: function (url, index) {
|
||||
|
||||
var afterNavigate = function () {
|
||||
|
Loading…
Reference in New Issue
Block a user