1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

remove btn backdrop show/hide

This commit is contained in:
grafixeyehero 2020-01-02 20:27:37 +03:00
parent 89b1fd7ce0
commit e0d6686bb4
3 changed files with 6 additions and 62 deletions

View file

@ -463,18 +463,12 @@ define(["loading", "appRouter", "layoutManager", "userSettings", "connectionMana
var imgUrl; var imgUrl;
var screenWidth = screen.availWidth; var screenWidth = screen.availWidth;
var hasbackdrop = false; var hasbackdrop = false;
var backdropWrapper = page.querySelector(".backdropWrapper");
var itemBackdropElement = page.querySelector("#itemBackdrop"); var itemBackdropElement = page.querySelector("#itemBackdrop");
var btnBackdropShow = page.querySelector(".btnBackdropShow");
var usePrimaryImage = item.MediaType === "Video" && item.Type !== "Movie" && item.Type !== "Trailer" || var usePrimaryImage = item.MediaType === "Video" && item.Type !== "Movie" && item.Type !== "Trailer" ||
item.MediaType && item.MediaType !== "Video" || item.MediaType && item.MediaType !== "Video" ||
item.Type === "MusicAlbum" || item.Type === "MusicAlbum" ||
item.Type === "MusicArtist"; item.Type === "MusicArtist";
if (layoutManager.mobile) {
backdropWrapper.classList.remove("hide");
}
if ("Program" === item.Type && item.ImageTags && item.ImageTags.Thumb) { if ("Program" === item.Type && item.ImageTags && item.ImageTags.Thumb) {
imgUrl = apiClient.getScaledImageUrl(item.Id, { imgUrl = apiClient.getScaledImageUrl(item.Id, {
type: "Thumb", type: "Thumb",
@ -482,7 +476,6 @@ define(["loading", "appRouter", "layoutManager", "userSettings", "connectionMana
tag: item.ImageTags.Thumb tag: item.ImageTags.Thumb
}); });
itemBackdropElement.classList.remove("noBackdrop"); itemBackdropElement.classList.remove("noBackdrop");
btnBackdropShow.classList.remove("hide");
imageLoader.lazyImage(itemBackdropElement, imgUrl, false); imageLoader.lazyImage(itemBackdropElement, imgUrl, false);
hasbackdrop = true; hasbackdrop = true;
} else if (usePrimaryImage && item.ImageTags && item.ImageTags.Primary) { } else if (usePrimaryImage && item.ImageTags && item.ImageTags.Primary) {
@ -492,7 +485,6 @@ define(["loading", "appRouter", "layoutManager", "userSettings", "connectionMana
tag: item.ImageTags.Primary tag: item.ImageTags.Primary
}); });
itemBackdropElement.classList.remove("noBackdrop"); itemBackdropElement.classList.remove("noBackdrop");
btnBackdropShow.classList.remove("hide");
imageLoader.lazyImage(itemBackdropElement, imgUrl, false); imageLoader.lazyImage(itemBackdropElement, imgUrl, false);
hasbackdrop = true; hasbackdrop = true;
} else if (item.BackdropImageTags && item.BackdropImageTags.length) { } else if (item.BackdropImageTags && item.BackdropImageTags.length) {
@ -502,7 +494,6 @@ define(["loading", "appRouter", "layoutManager", "userSettings", "connectionMana
tag: item.BackdropImageTags[0] tag: item.BackdropImageTags[0]
}); });
itemBackdropElement.classList.remove("noBackdrop"); itemBackdropElement.classList.remove("noBackdrop");
btnBackdropShow.classList.remove("hide");
imageLoader.lazyImage(itemBackdropElement, imgUrl, false); imageLoader.lazyImage(itemBackdropElement, imgUrl, false);
hasbackdrop = true; hasbackdrop = true;
} else if (item.ParentBackdropItemId && item.ParentBackdropImageTags && item.ParentBackdropImageTags.length) { } else if (item.ParentBackdropItemId && item.ParentBackdropImageTags && item.ParentBackdropImageTags.length) {
@ -512,7 +503,6 @@ define(["loading", "appRouter", "layoutManager", "userSettings", "connectionMana
tag: item.ParentBackdropImageTags[0] tag: item.ParentBackdropImageTags[0]
}); });
itemBackdropElement.classList.remove("noBackdrop"); itemBackdropElement.classList.remove("noBackdrop");
btnBackdropShow.classList.remove("hide");
imageLoader.lazyImage(itemBackdropElement, imgUrl, false); imageLoader.lazyImage(itemBackdropElement, imgUrl, false);
hasbackdrop = true; hasbackdrop = true;
} else if (item.ImageTags && item.ImageTags.Thumb) { } else if (item.ImageTags && item.ImageTags.Thumb) {
@ -522,12 +512,10 @@ define(["loading", "appRouter", "layoutManager", "userSettings", "connectionMana
tag: item.ImageTags.Thumb tag: item.ImageTags.Thumb
}); });
itemBackdropElement.classList.remove("noBackdrop"); itemBackdropElement.classList.remove("noBackdrop");
btnBackdropShow.classList.remove("hide");
imageLoader.lazyImage(itemBackdropElement, imgUrl, false); imageLoader.lazyImage(itemBackdropElement, imgUrl, false);
hasbackdrop = true; hasbackdrop = true;
} else { } else {
itemBackdropElement.classList.add("noBackdrop"); itemBackdropElement.classList.add("noBackdrop");
btnBackdropShow.classList.add("hide");
itemBackdropElement.style.backgroundImage = ""; itemBackdropElement.style.backgroundImage = "";
} }
@ -1925,26 +1913,6 @@ define(["loading", "appRouter", "layoutManager", "userSettings", "connectionMana
}); });
} }
function showBackdrop(instance, page, apiClient, params) {
var backdropWrapper = page.querySelector(".backdropWrapper");
var btnBackdropHide = page.querySelector(".btnBackdropHide");
var btnBackdropShow = page.querySelector(".btnBackdropShow");
backdropWrapper.classList.remove("hide");
btnBackdropHide.classList.remove("hide");
btnBackdropShow.classList.add("hide");
}
function hideBackdrop(instance, page, apiClient, params) {
var backdropWrapper = page.querySelector(".backdropWrapper");
var btnBackdropHide = page.querySelector(".btnBackdropHide");
var btnBackdropShow = page.querySelector(".btnBackdropShow");
backdropWrapper.classList.add("hide");
btnBackdropHide.classList.add("hide");
btnBackdropShow.classList.remove("hide");
}
function getPlayOptions(startPosition) { function getPlayOptions(startPosition) {
var audioStreamIndex = view.querySelector(".selectAudio").value || null; var audioStreamIndex = view.querySelector(".selectAudio").value || null;
return { return {
@ -2108,12 +2076,6 @@ define(["loading", "appRouter", "layoutManager", "userSettings", "connectionMana
renderAudioSelections(view, self._currentPlaybackMediaSources); renderAudioSelections(view, self._currentPlaybackMediaSources);
renderSubtitleSelections(view, self._currentPlaybackMediaSources); renderSubtitleSelections(view, self._currentPlaybackMediaSources);
}); });
view.querySelector(".btnBackdropShow").addEventListener("click", function () {
showBackdrop(self, view, apiClient, params);
});
view.querySelector(".btnBackdropHide").addEventListener("click", function () {
hideBackdrop(self, view, apiClient, params);
});
view.addEventListener("click", function (e) { view.addEventListener("click", function (e) {
if (dom.parentWithClass(e.target, "moreScenes")) { if (dom.parentWithClass(e.target, "moreScenes")) {
apiClient.getCurrentUser().then(function (user) { apiClient.getCurrentUser().then(function (user) {

View file

@ -1,14 +1,12 @@
<div id="itemDetailPage" data-role="page" class="page libraryPage itemDetailPage noSecondaryNavPage selfBackdropPage" data-backbutton="true"> <div id="itemDetailPage" data-role="page" class="page libraryPage itemDetailPage noSecondaryNavPage selfBackdropPage" data-backbutton="true">
<div class="backdropWrapper hide"> <div id="itemBackdrop" class="itemBackdrop noBackdrop">
<div id="itemBackdrop" class="itemBackdrop noBackdrop"> <button is="emby-button" type="button" class="btnPlay detailFloatingButton hide fab autoSize" title="${ButtonPlay}" data-mode="resume">
<button is="emby-button" type="button" class="btnPlay detailFloatingButton hide fab autoSize" title="${ButtonPlay}" data-mode="resume"> <i class="md-icon">play_arrow</i>
<i class="md-icon">play_arrow</i> </button>
</button>
</div>
<div class="detailLogo"></div>
</div> </div>
<div class="detailLogo"></div>
<div class="detailPageWrapperContainer"> <div class="detailPageWrapperContainer">
<div class="detailPagePrimaryContainer"> <div class="detailPagePrimaryContainer">
@ -110,20 +108,6 @@
<div class="detailButton-mobile-text">${ButtonMore}</div> <div class="detailButton-mobile-text">${ButtonMore}</div>
</div> </div>
</button> </button>
<button is="emby-button" type="button" class="button-flat btnBackdropShow hide detailButton">
<div class="detailButton-mobile-content">
<i class="md-icon detailButton-mobile-icon">photo</i>
<div class="detailButton-mobile-text">${ButtonShow}</div>
</div>
</button>
<button is="emby-button" type="button" class="button-flat btnBackdropHide hide detailButton">
<div class="detailButton-mobile-content">
<i class="md-icon detailButton-mobile-icon">photo</i>
<div class="detailButton-mobile-text">${ButtonHide}</div>
</div>
</button>
</div> </div>
</div> </div>
<div class="detailImageContainer verticalSection-extrabottompadding padded-left"></div> <div class="detailImageContainer verticalSection-extrabottompadding padded-left"></div>

View file

@ -84,7 +84,6 @@
"ButtonGotIt": "Got It", "ButtonGotIt": "Got It",
"ButtonGuide": "Guide", "ButtonGuide": "Guide",
"ButtonHelp": "Help", "ButtonHelp": "Help",
"ButtonHide": "Hide",
"ButtonHome": "Home", "ButtonHome": "Home",
"ButtonInfo": "Info", "ButtonInfo": "Info",
"ButtonLearnMore": "Learn more", "ButtonLearnMore": "Learn more",
@ -121,7 +120,6 @@
"ButtonSelectView": "Select view", "ButtonSelectView": "Select view",
"ButtonSend": "Send", "ButtonSend": "Send",
"ButtonSettings": "Settings", "ButtonSettings": "Settings",
"ButtonShow": "Show",
"ButtonShuffle": "Shuffle", "ButtonShuffle": "Shuffle",
"ButtonShutdown": "Shutdown", "ButtonShutdown": "Shutdown",
"ButtonSignIn": "Sign In", "ButtonSignIn": "Sign In",