(event)
| 119 | }, |
| 120 | |
| 121 | drop(event) { |
| 122 | event.preventDefault() |
| 123 | const files = event.dataTransfer?.files |
| 124 | const documentJSON = event.dataTransfer.getData("application/x-trix-document") |
| 125 | |
| 126 | const point = { x: event.clientX, y: event.clientY } |
| 127 | this.responder?.setLocationRangeFromPointRange(point) |
| 128 | |
| 129 | if (files?.length) { |
| 130 | this.attachFiles(files) |
| 131 | } else if (this.draggedRange) { |
| 132 | this.delegate?.inputControllerWillMoveText() |
| 133 | this.responder?.moveTextFromRange(this.draggedRange) |
| 134 | this.draggedRange = null |
| 135 | this.requestRender() |
| 136 | } else if (documentJSON) { |
| 137 | const document = Document.fromJSONString(documentJSON) |
| 138 | this.responder?.insertDocument(document) |
| 139 | this.requestRender() |
| 140 | } |
| 141 | |
| 142 | this.draggedRange = null |
| 143 | this.draggingPoint = null |
| 144 | }, |
| 145 | |
| 146 | cut(event) { |
| 147 | if (this.responder?.selectionIsExpanded()) { |
nothing calls this directly
no test coverage detected