fix editor, update libs shaka-player

This commit is contained in:
Filipinos 2025-06-27 11:02:59 +02:00
parent 926a465040
commit c321f6321e
4 changed files with 3216 additions and 3215 deletions

View File

@ -434,6 +434,9 @@ const editorHandler = (() => {
forceFallback: true, forceFallback: true,
ghostClass: 'sortable-ghost', ghostClass: 'sortable-ghost',
fallbackClass: 'sortable-fallback', fallbackClass: 'sortable-fallback',
scroll: true,
scrollSensitivity: 100,
scrollSpeed: 15,
onStart: () => { onStart: () => {
document.body.classList.add('editor-is-dragging'); document.body.classList.add('editor-is-dragging');
}, },
@ -446,22 +449,31 @@ const editorHandler = (() => {
if (item.classList.contains('group-header-row')) { if (item.classList.contains('group-header-row')) {
const [movedGroup] = groupOrder.splice(oldIndex, 1); const [movedGroup] = groupOrder.splice(oldIndex, 1);
groupOrder.splice(newIndex, 0, movedGroup); groupOrder.splice(newIndex, 0, movedGroup);
renderTable(); // Re-render for group order changes
} }
else if (item.classList.contains('channel-row') && currentGroupFilter !== '') { else if (item.classList.contains('channel-row') && currentGroupFilter !== '') {
const allVisibleIdsInOrder = Array.from(dom.tableBody.querySelectorAll('.channel-row')).map(row => row.dataset.editorId); const movedItemId = item.dataset.editorId;
const fromIndex = editorChannels.findIndex(ch => ch.editorId === movedItemId);
const [movedItem] = editorChannels.splice(fromIndex, 1);
const channelsInCurrentGroup = editorChannels.filter(ch => (ch['group-title'] || '') === currentGroupFilter); const allVisibleIdsInOrder = Array.from(dom.tableBody.querySelectorAll('.channel-row')).map(row => row.dataset.editorId);
const channelsInOtherGroups = editorChannels.filter(ch => (ch['group-title'] || '') !== currentGroupFilter); const toVisibleIndex = allVisibleIdsInOrder.indexOf(movedItemId);
const channelMap = new Map(channelsInCurrentGroup.map(ch => [ch.editorId, ch])); let targetIndexInFullArray = -1;
if (toVisibleIndex === 0) {
const firstVisibleChannelId = allVisibleIdsInOrder[1];
targetIndexInFullArray = editorChannels.findIndex(ch => ch.editorId === firstVisibleChannelId);
} else {
const previousVisibleChannelId = allVisibleIdsInOrder[toVisibleIndex -1];
targetIndexInFullArray = editorChannels.findIndex(ch => ch.editorId === previousVisibleChannelId) + 1;
}
const reorderedGroup = allVisibleIdsInOrder.map(id => channelMap.get(id)); editorChannels.splice(targetIndexInFullArray, 0, movedItem);
editorChannels = [...channelsInOtherGroups, ...reorderedGroup]; // No re-render, just move the element in DOM which Sortable does automatically
} }
currentSort.column = null; currentSort.column = null;
renderTable();
} }
}); });
} }

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff