mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Simplify show/hide button logic for tv providers
This commit is contained in:
parent
69a3c7cd53
commit
b65bd915ee
2 changed files with 10 additions and 26 deletions
|
@ -264,21 +264,13 @@ define(["jQuery", "loading", "emby-checkbox", "listViewStyle", "emby-input", "em
|
|||
self.init = function () {
|
||||
options = options || {};
|
||||
|
||||
// Only hide the button if explicitly set to false; default to showing if undefined or null
|
||||
// Only hide the buttons if explicitly set to false; default to showing if undefined or null
|
||||
// FIXME: rename this option to clarify logic
|
||||
if (options.showCancelButton === false) {
|
||||
page.querySelector(".btnCancel").classList.add("hide");
|
||||
} else {
|
||||
page.querySelector(".btnCancel").classList.remove("hide");
|
||||
}
|
||||
var hideCancelButton = options.showCancelButton === false;
|
||||
page.querySelector(".btnCancel").classList.toggle("hide", hideCancelButton);
|
||||
|
||||
// Only hide the button if explicitly set to false; default to showing if undefined or null
|
||||
// FIXME: rename this option to clarify logic
|
||||
if (options.showSubmitButton === false) {
|
||||
page.querySelector(".btnSubmitListings").classList.add("hide");
|
||||
} else {
|
||||
page.querySelector(".btnSubmitListings").classList.remove("hide");
|
||||
}
|
||||
var hideSubmitButton = options.showSubmitButton === false;
|
||||
page.querySelector(".btnSubmitListings").classList.toggle("hide", hideSubmitButton);
|
||||
|
||||
$(".formLogin", page).on("submit", function () {
|
||||
submitLoginForm();
|
||||
|
|
|
@ -163,21 +163,13 @@ define(["jQuery", "loading", "emby-checkbox", "emby-input", "listViewStyle", "pa
|
|||
self.init = function () {
|
||||
options = options || {};
|
||||
|
||||
// Only hide the button if explicitly set to false; default to showing if undefined or null
|
||||
// Only hide the buttons if explicitly set to false; default to showing if undefined or null
|
||||
// FIXME: rename this option to clarify logic
|
||||
if (options.showCancelButton === false) {
|
||||
page.querySelector(".btnCancel").classList.add("hide");
|
||||
} else {
|
||||
page.querySelector(".btnCancel").classList.remove("hide");
|
||||
}
|
||||
var hideCancelButton = options.showCancelButton === false;
|
||||
page.querySelector(".btnCancel").classList.toggle("hide", hideCancelButton);
|
||||
|
||||
// Only hide the button if explicitly set to false; default to showing if undefined or null
|
||||
// FIXME: rename this option to clarify logic
|
||||
if (options.showSubmitButton === false) {
|
||||
page.querySelector(".btnSubmitListings").classList.add("hide");
|
||||
} else {
|
||||
page.querySelector(".btnSubmitListings").classList.remove("hide");
|
||||
}
|
||||
var hideSubmitButton = options.showSubmitButton === false;
|
||||
page.querySelector(".btnSubmitListings").classList.toggle("hide", hideSubmitButton);
|
||||
|
||||
$("form", page).on("submit", function () {
|
||||
submitListingsForm();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue