mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 10:58:20 -07:00
remove nested form from library create dialog
This commit is contained in:
parent
b41ae5f483
commit
a5bad54c51
@ -1,10 +1,7 @@
|
||||
define(["loading", "dialogHelper", "dom", "jQuery", "components/libraryoptionseditor/libraryoptionseditor", "emby-toggle", "emby-input", "emby-select", "paper-icon-button-light", "listViewStyle", "formDialogStyle", "emby-button", "flexStyles"], function(loading, dialogHelper, dom, $, libraryoptionseditor) {
|
||||
"use strict";
|
||||
|
||||
function onSubmit(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
function onAddLibrary() {
|
||||
if (isCreating) return false;
|
||||
|
||||
if (pathInfos.length == 0) {
|
||||
@ -20,10 +17,9 @@ define(["loading", "dialogHelper", "dom", "jQuery", "components/libraryoptionsed
|
||||
isCreating = true;
|
||||
loading.show();
|
||||
|
||||
var form = this;
|
||||
var dlg = $(form).parents(".dialog")[0];
|
||||
var name = $("#txtValue", form).val();
|
||||
var type = $("#selectCollectionType", form).val();
|
||||
var dlg = dom.parentWithClass(this, "dlg-librarycreator");
|
||||
var name = $("#txtValue", dlg).val();
|
||||
var type = $("#selectCollectionType", dlg).val();
|
||||
if (type == "mixed") type = null;
|
||||
var libraryOptions = libraryoptionseditor.getLibraryOptions(dlg.querySelector(".libraryOptions"));
|
||||
libraryOptions.PathInfos = pathInfos;
|
||||
@ -73,7 +69,7 @@ define(["loading", "dialogHelper", "dom", "jQuery", "components/libraryoptionsed
|
||||
});
|
||||
|
||||
page.querySelector(".btnAddFolder").addEventListener("click", onAddButtonClick);
|
||||
page.querySelector("form").addEventListener("submit", onSubmit);
|
||||
page.querySelector(".btnSubmit").addEventListener("click", onAddLibrary);
|
||||
page.querySelector(".folderList").addEventListener("click", onRemoveClick);
|
||||
page.querySelector(".chkAdvanced").addEventListener("change", onToggleAdvancedChange);
|
||||
}
|
||||
@ -111,10 +107,10 @@ define(["loading", "dialogHelper", "dom", "jQuery", "components/libraryoptionsed
|
||||
|
||||
function addMediaLocation(page, path, networkSharePath) {
|
||||
var pathLower = path.toLowerCase();
|
||||
var path = pathInfos.filter(function(p) {
|
||||
var pathFilter = pathInfos.filter(function(p) {
|
||||
return p.Path.toLowerCase() == pathLower;
|
||||
});
|
||||
if (path.length === 0) {
|
||||
if (!pathFilter.length) {
|
||||
var pathInfo = {
|
||||
Path: path
|
||||
};
|
||||
|
@ -5,39 +5,39 @@
|
||||
|
||||
<div class="formDialogContent scrollY" style="padding-top:2em;">
|
||||
<div class="dialogContentInner dialog-content-centered">
|
||||
<form style="margin:auto;">
|
||||
<div class="inputContainer" style="text-align:right;">
|
||||
<label style="width:auto;">
|
||||
<input is="emby-toggle" type="checkbox" class="chkAdvanced noautofocus" />
|
||||
<span>${ShowAdvancedSettings}</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="inputContainer" style="text-align:right;">
|
||||
<label style="width:auto;">
|
||||
<input is="emby-toggle" type="checkbox" class="chkAdvanced noautofocus" />
|
||||
<span>${ShowAdvancedSettings}</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div id="fldCollectionType" class="selectContainer">
|
||||
<select is="emby-select" id="selectCollectionType" data-mini="true" required="required" label="${LabelContentType}"></select>
|
||||
<div class="collectionTypeFieldDescription fieldDescription">
|
||||
</div>
|
||||
<div id="fldCollectionType" class="selectContainer">
|
||||
<select is="emby-select" id="selectCollectionType" data-mini="true" required="required" label="${LabelContentType}"></select>
|
||||
<div class="collectionTypeFieldDescription fieldDescription">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="inputContainer">
|
||||
<input is="emby-input" type="text" id="txtValue" required="required" label="${LabelDisplayName}" />
|
||||
</div>
|
||||
<div class="inputContainer">
|
||||
<input is="emby-input" type="text" id="txtValue" required="required" label="${LabelDisplayName}" />
|
||||
</div>
|
||||
|
||||
<div class="folders">
|
||||
<div style="display: flex; align-items: center;">
|
||||
<h1 style="margin: .5em 0;">${HeadersFolders}</h1>
|
||||
<button is="emby-button" type="button" class="fab btnAddFolder submit" style="margin-left:1em;" title="${ButtonAdd}">
|
||||
<i class="md-icon">add</i>
|
||||
</button>
|
||||
<div class="paperList folderList hide" style="margin-bottom:2em;"></div>
|
||||
</div>
|
||||
<div class="paperList folderList hide" style="margin-bottom:2em;"></div>
|
||||
</div>
|
||||
|
||||
<div class="libraryOptions"></div>
|
||||
|
||||
<div class="formDialogFooter">
|
||||
<button is="emby-button" type="submit" class="raised button-submit block formDialogFooterItem">
|
||||
<span>${ButtonOk}</span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="libraryOptions"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="formDialogFooter">
|
||||
<button is="emby-button" type="button" class="raised btnSubmit button-submit block formDialogFooterItem">
|
||||
<span>${ButtonOk}</span>
|
||||
</button>
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user