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

update identify popup

This commit is contained in:
Luke Pulverenti 2016-05-03 22:29:49 -04:00
parent d4301f7089
commit 7d6818ac7d

View file

@ -1,4 +1,4 @@
define(['dialogHelper', 'jQuery', 'paper-fab', 'paper-input', 'paper-checkbox'], function (dialogHelper, $) { define(['dialogHelper', 'loading', 'jQuery', 'paper-fab', 'paper-input', 'paper-checkbox'], function (dialogHelper, loading, $) {
var currentItem; var currentItem;
var currentItemType; var currentItemType;
@ -56,7 +56,7 @@
IncludeDisabledProviders: true IncludeDisabledProviders: true
}; };
Dashboard.showLoadingMsg(); loading.show();
ApiClient.ajax({ ApiClient.ajax({
type: "POST", type: "POST",
@ -67,7 +67,7 @@
}).then(function (results) { }).then(function (results) {
Dashboard.hideLoadingMsg(); loading.hide();
showIdentificationSearchResults(page, results); showIdentificationSearchResults(page, results);
}); });
} }
@ -108,7 +108,7 @@
function finishFindNewDialog(dlg, identifyResult) { function finishFindNewDialog(dlg, identifyResult) {
currentSearchResult = identifyResult; currentSearchResult = identifyResult;
hasChanges = true; hasChanges = true;
Dashboard.hideLoadingMsg(); loading.hide();
dialogHelper.close(dlg); dialogHelper.close(dlg);
} }
@ -202,7 +202,7 @@
function submitIdentficationResult(page) { function submitIdentficationResult(page) {
Dashboard.showLoadingMsg(); loading.show();
var options = { var options = {
ReplaceAllImages: $('#chkIdentifyReplaceImages', page).checked() ReplaceAllImages: $('#chkIdentifyReplaceImages', page).checked()
@ -217,13 +217,13 @@
}).then(function () { }).then(function () {
hasChanges = true; hasChanges = true;
Dashboard.hideLoadingMsg(); loading.hide();
dialogHelper.close(page); dialogHelper.close(page);
}, function () { }, function () {
Dashboard.hideLoadingMsg(); loading.hide();
dialogHelper.close(page); dialogHelper.close(page);
}); });
@ -249,12 +249,12 @@
var value = providerIds[idInfo.Key] || ''; var value = providerIds[idInfo.Key] || '';
html += '<paper-input class="txtLookupId" value="' + value + '" data-providerkey="' + idInfo.Key + '" id="' + id + '" label="' + idLabel + '"></paper-input>'; html += '<paper-input class="txtLookupId" data-providerkey="' + idInfo.Key + '" id="' + id + '" label="' + idLabel + '"></paper-input>';
html += '</div>'; html += '</div>';
} }
$('#txtLookupName', page).val(item.Name); $('#txtLookupName', page).val('');
if (item.Type == "Person" || item.Type == "BoxSet") { if (item.Type == "Person" || item.Type == "BoxSet") {
@ -263,7 +263,7 @@
} else { } else {
$('.fldLookupYear', page).show(); $('.fldLookupYear', page).show();
$('#txtLookupYear', page).val(item.ProductionYear); $('#txtLookupYear', page).val('');
} }
$('.identifyProviderIds', page).html(html); $('.identifyProviderIds', page).html(html);
@ -274,7 +274,7 @@
function showEditor(itemId) { function showEditor(itemId) {
Dashboard.showLoadingMsg(); loading.show();
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.open('GET', 'components/itemidentifier/itemidentifier.template.html', true); xhr.open('GET', 'components/itemidentifier/itemidentifier.template.html', true);
@ -282,7 +282,7 @@
xhr.onload = function (e) { xhr.onload = function (e) {
var template = this.response; var template = this.response;
ApiClient.getItem(Dashboard.getCurrentUserId(), itemId).then(function (item) { ApiClient.getItem(ApiClient.getCurrentUserId(), itemId).then(function (item) {
currentItem = item; currentItem = item;
currentItemType = currentItem.Type; currentItemType = currentItem.Type;
@ -327,7 +327,7 @@
dlg.classList.add('identifyDialog'); dlg.classList.add('identifyDialog');
showIdentificationForm(dlg, item); showIdentificationForm(dlg, item);
Dashboard.hideLoadingMsg(); loading.hide();
}); });
} }
@ -337,7 +337,7 @@
function onDialogClosed() { function onDialogClosed() {
$(this).remove(); $(this).remove();
Dashboard.hideLoadingMsg(); loading.hide();
currentDeferred.resolveWith(null, [hasChanges]); currentDeferred.resolveWith(null, [hasChanges]);
} }
@ -382,7 +382,7 @@
dlg.addEventListener('close', function () { dlg.addEventListener('close', function () {
Dashboard.hideLoadingMsg(); loading.hide();
var foundItem = hasChanges ? currentSearchResult : null; var foundItem = hasChanges ? currentSearchResult : null;
resolveFunc(foundItem); resolveFunc(foundItem);