update single recording editor

This commit is contained in:
Luke Pulverenti 2016-10-28 14:08:49 -04:00
parent a6a50ab5d4
commit 749cd7dbb3
3 changed files with 17 additions and 20 deletions

View File

@ -14,12 +14,12 @@
},
"devDependencies": {},
"ignore": [],
"version": "1.4.325",
"_release": "1.4.325",
"version": "1.4.326",
"_release": "1.4.326",
"_resolution": {
"type": "version",
"tag": "1.4.325",
"commit": "f11f822888ef812064c9a2677dc5c639e82cbb9f"
"tag": "1.4.326",
"commit": "2f0db5f0b27eccd17c1a451bde9ae537d083a89d"
},
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
"_target": "^1.2.1",

View File

@ -3,9 +3,9 @@
var currentDialog;
var recordingDeleted = false;
var recordingUpdated = false;
var currentItemId;
var currentServerId;
var currentResolve;
function deleteTimer(apiClient, timerId) {
@ -44,7 +44,10 @@
apiClient.getLiveTvTimer(currentItemId).then(function (item) {
item.PrePaddingSeconds = form.querySelector('#txtPrePaddingMinutes').value * 60;
item.PostPaddingSeconds = form.querySelector('#txtPostPaddingMinutes').value * 60;
apiClient.updateLiveTvTimer(item).then(currentResolve);
apiClient.updateLiveTvTimer(item).then(function () {
recordingUpdated = true;
closeDialog(false);
});
});
e.preventDefault();
@ -92,7 +95,6 @@
currentServerId = serverId;
loading.show();
options = options || {};
currentResolve = resolve;
require(['text!./recordingeditor.template.html'], function (template) {
@ -122,26 +124,21 @@
dlg.innerHTML = html;
if (options.enableCancel === false) {
dlg.querySelector('.formDialogFooter').classList.add('hide');
if (!options.enableCancel) {
dlg.querySelector('.btnCancelRecording').classList.add('hide');
}
currentDialog = dlg;
dlg.addEventListener('closing', function () {
if (!recordingDeleted) {
dlg.querySelector('.btnSubmit').click();
}
});
dlg.addEventListener('close', function () {
if (recordingDeleted) {
if (recordingDeleted || recordingUpdated) {
resolve({
updated: true,
deleted: true
updated: recordingUpdated,
deleted: recordingDeleted
});
} else {
reject();
}
});

View File

@ -33,7 +33,7 @@
<br />
<div class="formDialogFooter">
<button is="emby-button" type="submit" class="raised btnSubmit block formDialogFooterItem button-submit hide">
<button is="emby-button" type="submit" class="raised btnSubmit block formDialogFooterItem button-submit">
<span>${Save}</span>
</button>
<button is="emby-button" type="button" class="raised btnCancelRecording block formDialogFooterItem button-cancel" style="white-space:nowrap;">