refactor: give variables more descriptive names
This commit is contained in:
parent
e79f326c53
commit
bf145a602c
3 changed files with 22 additions and 22 deletions
|
@ -293,21 +293,21 @@ import toast from './toast/toast';
|
|||
const apiClient = ServerConnections.getApiClient(serverId);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
const myServerId = apiClient.serverInfo().Id;
|
||||
const currentServerId = apiClient.serverInfo().Id;
|
||||
|
||||
if (item.Type === 'Timer') {
|
||||
if (item.ProgramId) {
|
||||
import('./recordingcreator/recordingcreator').then(({default: recordingCreator}) => {
|
||||
recordingCreator.show(item.ProgramId, myServerId).then(resolve, reject);
|
||||
recordingCreator.show(item.ProgramId, currentServerId).then(resolve, reject);
|
||||
});
|
||||
} else {
|
||||
import('./recordingcreator/recordingeditor').then(({default: recordingEditor}) => {
|
||||
recordingEditor.show(item.Id, myServerId).then(resolve, reject);
|
||||
recordingEditor.show(item.Id, currentServerId).then(resolve, reject);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
import('./metadataEditor/metadataEditor').then(({default: metadataEditor}) => {
|
||||
metadataEditor.show(item.Id, myServerId).then(resolve, reject);
|
||||
metadataEditor.show(item.Id, currentServerId).then(resolve, reject);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1346,13 +1346,13 @@ function tryRemoveElement(elem) {
|
|||
return import('./style.scss').then(() => {
|
||||
loading.show();
|
||||
|
||||
const newdlg = document.createElement('div');
|
||||
newdlg.setAttribute('dir', 'ltr');
|
||||
const playerDlg = document.createElement('div');
|
||||
playerDlg.setAttribute('dir', 'ltr');
|
||||
|
||||
newdlg.classList.add('videoPlayerContainer');
|
||||
playerDlg.classList.add('videoPlayerContainer');
|
||||
|
||||
if (options.fullscreen) {
|
||||
newdlg.classList.add('videoPlayerContainer-onTop');
|
||||
playerDlg.classList.add('videoPlayerContainer-onTop');
|
||||
}
|
||||
|
||||
let html = '';
|
||||
|
@ -1371,8 +1371,8 @@ function tryRemoveElement(elem) {
|
|||
|
||||
html += '</video>';
|
||||
|
||||
newdlg.innerHTML = html;
|
||||
const videoElement = newdlg.querySelector('video');
|
||||
playerDlg.innerHTML = html;
|
||||
const videoElement = playerDlg.querySelector('video');
|
||||
|
||||
videoElement.volume = getSavedVolume();
|
||||
videoElement.addEventListener('timeupdate', this.onTimeUpdate);
|
||||
|
@ -1388,8 +1388,8 @@ function tryRemoveElement(elem) {
|
|||
videoElement.poster = options.backdropUrl;
|
||||
}
|
||||
|
||||
document.body.insertBefore(newdlg, document.body.firstChild);
|
||||
this.#videoDialog = newdlg;
|
||||
document.body.insertBefore(playerDlg, document.body.firstChild);
|
||||
this.#videoDialog = playerDlg;
|
||||
this.#mediaElement = videoElement;
|
||||
|
||||
delete this.forcedFullscreen;
|
||||
|
@ -1408,7 +1408,7 @@ function tryRemoveElement(elem) {
|
|||
|
||||
// don't animate on smart tv's, too slow
|
||||
if (!browser.slow && browser.supportsCssAnimation()) {
|
||||
return zoomIn(newdlg).then(function () {
|
||||
return zoomIn(playerDlg).then(function () {
|
||||
return videoElement;
|
||||
});
|
||||
}
|
||||
|
|
|
@ -32,26 +32,26 @@ function createMediaElement(instance, options) {
|
|||
import('./style.scss').then(() => {
|
||||
loading.show();
|
||||
|
||||
const newdlg = document.createElement('div');
|
||||
const playerDlg = document.createElement('div');
|
||||
|
||||
newdlg.classList.add('youtubePlayerContainer');
|
||||
playerDlg.classList.add('youtubePlayerContainer');
|
||||
|
||||
if (options.fullscreen) {
|
||||
newdlg.classList.add('onTop');
|
||||
playerDlg.classList.add('onTop');
|
||||
}
|
||||
|
||||
newdlg.innerHTML = '<div id="player"></div>';
|
||||
const videoElement = newdlg.querySelector('#player');
|
||||
playerDlg.innerHTML = '<div id="player"></div>';
|
||||
const videoElement = playerDlg.querySelector('#player');
|
||||
|
||||
document.body.insertBefore(newdlg, document.body.firstChild);
|
||||
instance.videoDialog = newdlg;
|
||||
document.body.insertBefore(playerDlg, document.body.firstChild);
|
||||
instance.videoDialog = playerDlg;
|
||||
|
||||
if (options.fullscreen) {
|
||||
document.body.classList.add('hide-scroll');
|
||||
}
|
||||
|
||||
if (options.fullscreen && newdlg.animate && !browser.slow) {
|
||||
zoomIn(newdlg, 1).onfinish = function () {
|
||||
if (options.fullscreen && playerDlg.animate && !browser.slow) {
|
||||
zoomIn(playerDlg, 1).onfinish = function () {
|
||||
resolve(videoElement);
|
||||
};
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue