mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-13 11:23:50 +00:00
Feat: reorder events with alt+ctrl + arrow up/down (#645)
* fix: key guard * feat: reorder events * refactor: return index from the getEvent functions
This commit is contained in:
committed by
GitHub
parent
b2c01a141a
commit
96280e5932
@@ -45,7 +45,7 @@ export function getIncrement(input: string): string {
|
||||
*/
|
||||
export function getCueCandidate(rundown: OntimeRundown, insertAfterId?: string): string {
|
||||
function addAtTop() {
|
||||
const firstEventCue = getFirstEvent(rundown)?.cue;
|
||||
const firstEventCue = getFirstEvent(rundown).firstEvent?.cue;
|
||||
|
||||
if (isNumeric(firstEventCue)) {
|
||||
return (Number(firstEventCue) / 10).toString();
|
||||
@@ -68,11 +68,11 @@ export function getCueCandidate(rundown: OntimeRundown, insertAfterId?: string):
|
||||
// get elements around
|
||||
let previousEvent: OntimeRundownEntry | undefined | null | OntimeEvent = rundown.at(afterIndex);
|
||||
if (!isOntimeEvent(previousEvent)) {
|
||||
previousEvent = getPreviousEvent(rundown, insertAfterId) as null | OntimeEvent;
|
||||
previousEvent = getPreviousEvent(rundown, insertAfterId).previousEvent as null | OntimeEvent;
|
||||
}
|
||||
|
||||
let cue = '1';
|
||||
const nextEvent = getNextEvent(rundown, insertAfterId);
|
||||
const { nextEvent } = getNextEvent(rundown, insertAfterId);
|
||||
|
||||
// try and increment the cue
|
||||
if (isOntimeEvent(previousEvent)) {
|
||||
|
||||
Reference in New Issue
Block a user