Skip to content

Commit

Permalink
refactor: remove unnecessary type convert
Browse files Browse the repository at this point in the history
  • Loading branch information
bubkoo committed Dec 10, 2019
1 parent 96549ff commit 09a9cb4
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions packages/x6/src/handler/keyboard/handler.ts
@@ -1,7 +1,6 @@
import * as util from '../../util'
import { Graph } from '../../graph'
import { Mousetrap } from './mousetrap'
import { KeyboardOptions } from './option'
import { BaseHandler } from '../handler-base'
import { DomEvent, Disposable } from '../../common'

Expand All @@ -12,13 +11,8 @@ export class KeyboardHandler extends BaseHandler {

constructor(graph: Graph) {
super(graph)
const options = this.graph.options.keyboard as KeyboardOptions
if (options.enabled) {
this.enable()
} else {
this.disable()
}

const options = this.graph.options.keyboard
this.setEnadled(options.enabled)
this.target = options.global ? document : this.graph.container
this.formatkey = options.formatkey || ((key: string) => key)
this.mousetrap = new Mousetrap(this.target as Element, this)
Expand Down

0 comments on commit 09a9cb4

Please sign in to comment.