mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #4446 from robert-hamilton36/MultiSelectContextMenu
Add Select context menu
This commit is contained in:
commit
8341e08ef5
3 changed files with 21 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
import browser from '../scripts/browser';
|
||||
import { copy } from '../scripts/clipboard';
|
||||
import dom from '../scripts/dom';
|
||||
import globalize from '../scripts/globalize';
|
||||
import actionsheet from './actionSheet/actionSheet';
|
||||
import { appHost } from './apphost';
|
||||
|
@ -98,6 +99,16 @@ export function getCommands(options) {
|
|||
}
|
||||
|
||||
if (!browser.tv) {
|
||||
// Multiselect is currrently only ran on long clicks of card components
|
||||
// This disables Select on any context menu not originating from a card i.e songs
|
||||
if (options.positionTo && (dom.parentWithClass(options.positionTo, 'card') !== null)) {
|
||||
commands.push({
|
||||
name: globalize.translate('Select'),
|
||||
id: 'multiSelect',
|
||||
icon: 'library_add_check'
|
||||
});
|
||||
}
|
||||
|
||||
if (itemHelper.supportsAddingToCollection(item) && options.EnableCollectionManagement) {
|
||||
commands.push({
|
||||
name: globalize.translate('AddToCollection'),
|
||||
|
@ -432,6 +443,12 @@ function executeCommand(item, id, options) {
|
|||
itemMediaInfo.show(itemId, serverId).then(getResolveFunction(resolve, id), getResolveFunction(resolve, id));
|
||||
});
|
||||
break;
|
||||
case 'multiSelect':
|
||||
import('./multiSelect/multiSelect').then(({ startMultiSelect: startMultiSelect }) => {
|
||||
const card = dom.parentWithClass(options.positionTo, 'card');
|
||||
startMultiSelect(card);
|
||||
});
|
||||
break;
|
||||
case 'refresh':
|
||||
refresh(apiClient, item);
|
||||
getResolveFunction(resolve, id)();
|
||||
|
|
|
@ -564,3 +564,6 @@ export default function (options) {
|
|||
};
|
||||
}
|
||||
|
||||
export const startMultiSelect = (card) => {
|
||||
showSelections(card);
|
||||
};
|
||||
|
|
|
@ -1685,6 +1685,7 @@
|
|||
"Interview": "Interview",
|
||||
"Scene": "Scene",
|
||||
"Sample": "Sample",
|
||||
"Select": "Select",
|
||||
"ThemeSong": "Theme Song",
|
||||
"ThemeVideo": "Theme Video",
|
||||
"EnableEnhancedNvdecDecoderHelp": "Experimental NVDEC implementation, do not enable this option unless you encounter decoding errors.",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue