mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fixes
This commit is contained in:
parent
6c4528f0dc
commit
8432ac0da7
4 changed files with 38 additions and 12949 deletions
|
@ -1,7 +1,6 @@
|
||||||
import dialogHelper from 'dialogHelper';
|
import dialogHelper from 'dialogHelper';
|
||||||
import layoutManager from 'layoutManager';
|
import layoutManager from 'layoutManager';
|
||||||
import globalize from 'globalize';
|
import globalize from 'globalize';
|
||||||
// import browser from 'browser';
|
|
||||||
import dom from 'dom';
|
import dom from 'dom';
|
||||||
import 'emby-button';
|
import 'emby-button';
|
||||||
import 'css!./actionSheet';
|
import 'css!./actionSheet';
|
||||||
|
@ -11,19 +10,14 @@ import 'listViewStyle';
|
||||||
|
|
||||||
function getOffsets(elems) {
|
function getOffsets(elems) {
|
||||||
|
|
||||||
var doc = document;
|
|
||||||
var results = [];
|
var results = [];
|
||||||
|
|
||||||
if (!doc) {
|
if (!document) {
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
var box;
|
var box;
|
||||||
var elem;
|
for (let elem in elems) {
|
||||||
|
|
||||||
for (var i = 0, length = elems.length; i < length; i++) {
|
|
||||||
|
|
||||||
elem = elems[i];
|
|
||||||
// Support: BlackBerry 5, iOS 3 (original iPhone)
|
// Support: BlackBerry 5, iOS 3 (original iPhone)
|
||||||
// If we don't have gBCR, just use 0,0 rather than error
|
// If we don't have gBCR, just use 0,0 rather than error
|
||||||
if (elem.getBoundingClientRect) {
|
if (elem.getBoundingClientRect) {
|
||||||
|
@ -147,17 +141,12 @@ export function show(options) {
|
||||||
style += "min-width:" + minWidth + "px;";
|
style += "min-width:" + minWidth + "px;";
|
||||||
}
|
}
|
||||||
|
|
||||||
var i;
|
|
||||||
var length;
|
|
||||||
var option;
|
|
||||||
var renderIcon = false;
|
var renderIcon = false;
|
||||||
var icons = [];
|
var icons = [];
|
||||||
var itemIcon;
|
var itemIcon;
|
||||||
for (i = 0, length = options.items.length; i < length; i++) {
|
for (let item in options.items) {
|
||||||
|
|
||||||
option = options.items[i];
|
itemIcon = item.icon || (item.selected ? 'check' : null);
|
||||||
|
|
||||||
itemIcon = option.icon || (option.selected ? 'check' : null);
|
|
||||||
|
|
||||||
if (itemIcon) {
|
if (itemIcon) {
|
||||||
renderIcon = true;
|
renderIcon = true;
|
||||||
|
@ -214,20 +203,18 @@ export function show(options) {
|
||||||
menuItemClass += ' actionsheet-xlargeFont';
|
menuItemClass += ' actionsheet-xlargeFont';
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0, length = options.items.length; i < length; i++) {
|
for (let item in options.items) {
|
||||||
|
|
||||||
option = options.items[i];
|
if (item.divider) {
|
||||||
|
|
||||||
if (option.divider) {
|
|
||||||
|
|
||||||
html += '<div class="actionsheetDivider"></div>';
|
html += '<div class="actionsheetDivider"></div>';
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var autoFocus = option.selected && layoutManager.tv ? ' autoFocus' : '';
|
var autoFocus = item.selected && layoutManager.tv ? ' autoFocus' : '';
|
||||||
|
|
||||||
// Check for null in case int 0 was passed in
|
// Check for null in case int 0 was passed in
|
||||||
var optionId = option.id == null || option.id === '' ? option.value : option.id;
|
var optionId = item.id == null || item.id === '' ? item.value : item.id;
|
||||||
html += '<button' + autoFocus + ' is="emby-button" type="button" class="' + menuItemClass + '" data-id="' + optionId + '">';
|
html += '<button' + autoFocus + ' is="emby-button" type="button" class="' + menuItemClass + '" data-id="' + optionId + '">';
|
||||||
|
|
||||||
itemIcon = icons[i];
|
itemIcon = icons[i];
|
||||||
|
@ -242,20 +229,20 @@ export function show(options) {
|
||||||
html += '<div class="listItemBody actionsheetListItemBody">';
|
html += '<div class="listItemBody actionsheetListItemBody">';
|
||||||
|
|
||||||
html += '<div class="listItemBodyText actionSheetItemText">';
|
html += '<div class="listItemBodyText actionSheetItemText">';
|
||||||
html += (option.name || option.textContent || option.innerText);
|
html += (item.name || item.textContent || item.innerText);
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
if (option.secondaryText) {
|
if (item.secondaryText) {
|
||||||
html += '<div class="listItemBodyText secondary">';
|
html += '<div class="listItemBodyText secondary">';
|
||||||
html += option.secondaryText;
|
html += item.secondaryText;
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
if (option.asideText) {
|
if (item.asideText) {
|
||||||
html += '<div class="listItemAside actionSheetItemAsideText">';
|
html += '<div class="listItemAside actionSheetItemAsideText">';
|
||||||
html += option.asideText;
|
html += item.asideText;
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,28 +16,24 @@ function alertText(options) {
|
||||||
export function deleteItem(options) {
|
export function deleteItem(options) {
|
||||||
|
|
||||||
var item = options.item;
|
var item = options.item;
|
||||||
var itemId = item.Id;
|
|
||||||
var parentId = item.SeasonId || item.SeriesId || item.ParentId;
|
var parentId = item.SeasonId || item.SeriesId || item.ParentId;
|
||||||
var serverId = item.ServerId;
|
|
||||||
|
|
||||||
var msg = globalize.translate('ConfirmDeleteItem');
|
|
||||||
var title = globalize.translate('HeaderDeleteItem');
|
|
||||||
var apiClient = connectionManager.getApiClient(item.ServerId);
|
var apiClient = connectionManager.getApiClient(item.ServerId);
|
||||||
|
|
||||||
return confirm({
|
return confirm({
|
||||||
|
|
||||||
title: title,
|
title: globalize.translate('HeaderDeleteItem'),
|
||||||
text: msg,
|
text: globalize.translate('ConfirmDeleteItem'),
|
||||||
confirmText: globalize.translate('Delete'),
|
confirmText: globalize.translate('Delete'),
|
||||||
primary: 'delete'
|
primary: 'delete'
|
||||||
|
|
||||||
}).then(function () {
|
}).then(function () {
|
||||||
|
|
||||||
return apiClient.deleteItem(itemId).then(function () {
|
return apiClient.deleteItem(item.Id).then(function () {
|
||||||
|
|
||||||
if (options.navigate) {
|
if (options.navigate) {
|
||||||
if (parentId) {
|
if (parentId) {
|
||||||
appRouter.showItem(parentId, serverId);
|
appRouter.showItem(parentId, item.ServerId);
|
||||||
} else {
|
} else {
|
||||||
appRouter.goHome();
|
appRouter.goHome();
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,25 +2,19 @@ import actionsheet from 'actionsheet';
|
||||||
import datetime from 'datetime';
|
import datetime from 'datetime';
|
||||||
import playbackManager from 'playbackManager';
|
import playbackManager from 'playbackManager';
|
||||||
import globalize from 'globalize';
|
import globalize from 'globalize';
|
||||||
// import appSettings from 'appSettings';
|
|
||||||
|
|
||||||
export function show(options) {
|
export function show(options) {
|
||||||
|
|
||||||
var item = options.item;
|
var item = options.item;
|
||||||
|
|
||||||
var itemType = item.Type;
|
|
||||||
var isFolder = item.IsFolder;
|
|
||||||
var itemId = item.Id;
|
|
||||||
var channelId = item.ChannelId;
|
|
||||||
var serverId = item.ServerId;
|
|
||||||
var resumePositionTicks = item.UserData ? item.UserData.PlaybackPositionTicks : null;
|
var resumePositionTicks = item.UserData ? item.UserData.PlaybackPositionTicks : null;
|
||||||
|
|
||||||
var playableItemId = itemType === 'Program' ? channelId : itemId;
|
var playableItemId = item.Type === 'Program' ? item.ChannelId : item.Id;
|
||||||
|
|
||||||
if (!resumePositionTicks || isFolder) {
|
if (!resumePositionTicks || item.IsFolder) {
|
||||||
playbackManager.play({
|
playbackManager.play({
|
||||||
ids: [playableItemId],
|
ids: [playableItemId],
|
||||||
serverId: serverId
|
serverId: item.ServerId
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -46,28 +40,28 @@ export function show(options) {
|
||||||
switch (id) {
|
switch (id) {
|
||||||
|
|
||||||
case 'play':
|
case 'play':
|
||||||
playbackManager.play({
|
playbackManager.play({
|
||||||
ids: [playableItemId],
|
ids: [playableItemId],
|
||||||
serverId: serverId
|
serverId: item.ServerId
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'resume':
|
case 'resume':
|
||||||
playbackManager.play({
|
playbackManager.play({
|
||||||
ids: [playableItemId],
|
ids: [playableItemId],
|
||||||
startPositionTicks: resumePositionTicks,
|
startPositionTicks: resumePositionTicks,
|
||||||
serverId: serverId
|
serverId: item.ServerId
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'queue':
|
case 'queue':
|
||||||
playbackManager.queue({
|
playbackManager.queue({
|
||||||
items: [item]
|
items: [item]
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'shuffle':
|
case 'shuffle':
|
||||||
playbackManager.shuffle(item);
|
playbackManager.shuffle(item);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
12888
yarn-error.log
12888
yarn-error.log
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue