# All files / js events.jsx

8.33% Statements 1/12
0% Branches 0/16
0% Functions 0/4
8.33% Lines 1/12

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46

    1x

     'use strict'

    class Event {
      get type () {
        return Object.getPrototypeOf(this).constructor.getEventType()
      }

      toString () {
        return '[Event ' + this.type + ']'
      }
    }

    Event.getEventType = function () {
      return this.name
    }

    class RecordEvent extends Event {
      constructor (options) {
        super(options = options || {})
        this.recordPath = options.recordPath
      }
    }

    class AttachmentsChangedEvent extends RecordEvent {
      constructor (options) {
        super(options = options || {})
        this.attachmentsAdded = options.attachmentsAdded || []
        this.attachmentsRemoved = options.attachmentsRemoved || []
      }
    }

    class DialogChangedEvent extends Event {
      constructor (options) {
        super(options = options || {})
        this.dialog = options.dialog
        this.dialogOptions = options.dialogOptions
      }
    }

    export {
      Event,
      RecordEvent,
      AttachmentsChangedEvent,
      DialogChangedEvent
    }