Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "internal/dnd"

Index

Type aliases

IDragEffect

IDragEffect: "none" | "copy" | "copyLink" | "copyMove" | "link" | "linkMove" | "move" | "all"

Functions

copyDnD

  • copyDnD(e: DragEvent): boolean
  • checks whether it is a copy operation

    internal

    Parameters

    • e: DragEvent

    Returns boolean

dragAble

  • dragAble(node: HTMLElement, onDragStart: function, stopPropagation?: boolean): void
  • add drag support for the given element

    internal

    Parameters

    • node: HTMLElement
    • onDragStart: function

      callback to compute the payload an object of mime types

    • Default value stopPropagation: boolean = false

      whether to stop propagation in case of success

    Returns void

dropAble

  • dropAble(node: HTMLElement, mimeTypes: string[], onDrop: function, onDragOver?: null | function, stopPropagation?: boolean): void
  • add dropable support for the given node

    internal

    Parameters

    • node: HTMLElement
    • mimeTypes: string[]

      mimeTypes to look for

    • onDrop: function

      callback when dropped, returns true if the drop was successful

    • Default value onDragOver: null | function = null

      optional drag over handler, e.g. for special effects

    • Default value stopPropagation: boolean = false

      flag if the event propagation should be stopped in case of success

    Returns void

hasDnDType

  • hasDnDType(e: DragEvent, ...typesToCheck: string[]): boolean
  • Parameters

    • e: DragEvent
    • Rest ...typesToCheck: string[]

    Returns boolean

updateDropEffect

  • updateDropEffect(e: DragEvent): void
  • updates the drop effect accoriding to the current copyDnD state

    internal

    Parameters

    • e: DragEvent

    Returns void