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 () {
|
self.init = function () {
|
||||||
options = options || {};
|
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
|
// FIXME: rename this option to clarify logic
|
||||||
if (options.showCancelButton === false) {
|
var hideCancelButton = options.showCancelButton === false;
|
||||||
page.querySelector(".btnCancel").classList.add("hide");
|
page.querySelector(".btnCancel").classList.toggle("hide", hideCancelButton);
|
||||||
} else {
|
|
||||||
page.querySelector(".btnCancel").classList.remove("hide");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Only hide the button if explicitly set to false; default to showing if undefined or null
|
var hideSubmitButton = options.showSubmitButton === false;
|
||||||
// FIXME: rename this option to clarify logic
|
page.querySelector(".btnSubmitListings").classList.toggle("hide", hideSubmitButton);
|
||||||
if (options.showSubmitButton === false) {
|
|
||||||
page.querySelector(".btnSubmitListings").classList.add("hide");
|
|
||||||
} else {
|
|
||||||
page.querySelector(".btnSubmitListings").classList.remove("hide");
|
|
||||||
}
|
|
||||||
|
|
||||||
$(".formLogin", page).on("submit", function () {
|
$(".formLogin", page).on("submit", function () {
|
||||||
submitLoginForm();
|
submitLoginForm();
|
||||||
|
|
|
@ -163,21 +163,13 @@ define(["jQuery", "loading", "emby-checkbox", "emby-input", "listViewStyle", "pa
|
||||||
self.init = function () {
|
self.init = function () {
|
||||||
options = options || {};
|
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
|
// FIXME: rename this option to clarify logic
|
||||||
if (options.showCancelButton === false) {
|
var hideCancelButton = options.showCancelButton === false;
|
||||||
page.querySelector(".btnCancel").classList.add("hide");
|
page.querySelector(".btnCancel").classList.toggle("hide", hideCancelButton);
|
||||||
} else {
|
|
||||||
page.querySelector(".btnCancel").classList.remove("hide");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Only hide the button if explicitly set to false; default to showing if undefined or null
|
var hideSubmitButton = options.showSubmitButton === false;
|
||||||
// FIXME: rename this option to clarify logic
|
page.querySelector(".btnSubmitListings").classList.toggle("hide", hideSubmitButton);
|
||||||
if (options.showSubmitButton === false) {
|
|
||||||
page.querySelector(".btnSubmitListings").classList.add("hide");
|
|
||||||
} else {
|
|
||||||
page.querySelector(".btnSubmitListings").classList.remove("hide");
|
|
||||||
}
|
|
||||||
|
|
||||||
$("form", page).on("submit", function () {
|
$("form", page).on("submit", function () {
|
||||||
submitListingsForm();
|
submitListingsForm();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue