Skip to content

Commit

Permalink
refactor(keyboard_commands): remove import reference that no longer e…
Browse files Browse the repository at this point in the history
…xists
  • Loading branch information
louh committed Jul 3, 2022
1 parent 4abc32f commit 00830ef
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions assets/scripts/app/keyboard_commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import { noop } from 'lodash'

import USER_ROLES from '../../../app/data/user_roles'
import { DRAGGING_TYPE_RESIZE, DRAGGING_TYPE_MOVE } from '../segments/constants'
// check looks like this dosen't exist anymore
// eslint-disable-next-line import/named
import { handleSegmentMoveCancel } from '../segments/drag_and_drop'
import { handleSegmentResizeCancel } from '../segments/resizing'
import { getSignInData, isSignedIn } from '../users/authentication'
import { formatMessage } from '../locales/locale'
Expand All @@ -16,21 +13,24 @@ import { registerKeypress } from './keypress'
import { ENV } from './config'

export function onGlobalKeyDown (event) {
const { draggingType } = store.getState().ui

switch (event.key) {
case 'Esc': // IE/Edge specific value
case 'Escape':
case 'Escape': {
const { draggingType } = store.getState().ui

if (draggingType === DRAGGING_TYPE_RESIZE) {
handleSegmentResizeCancel()
} else if (draggingType === DRAGGING_TYPE_MOVE) {
handleSegmentMoveCancel()
// We don't handle this here anymore
// TODO: Double check on side effects of not handling this
return
} else {
return
}

event.preventDefault()
break
}
}
}

Expand Down

0 comments on commit 00830ef

Please sign in to comment.