(path, dispatchEvent = true)
| 353 | } |
| 354 | |
| 355 | selectEntry(path, dispatchEvent = true) { |
| 356 | if (path !== undefined) { |
| 357 | const entries = this.modelElements |
| 358 | |
| 359 | for (const elem of entries) { |
| 360 | if (elem.dataset.path == path) { |
| 361 | this.saveCurrentSelection(elem, elem.innerText, elem.dataset.path, dispatchEvent) |
| 362 | this.highlightedModelEntry = elem |
| 363 | elem.scrollIntoView({ block: "nearest" }) |
| 364 | break |
| 365 | } |
| 366 | } |
| 367 | } |
| 368 | |
| 369 | if (this.currentSelection.elem !== undefined) { |
| 370 | // select the previous element |
| 371 | if (this.highlightedModelEntry !== undefined && this.highlightedModelEntry != this.currentSelection.elem) { |
| 372 | this.highlightedModelEntry.classList.remove("selected") |
| 373 | } |
| 374 | this.currentSelection.elem.classList.add("selected") |
| 375 | this.highlightedModelEntry = this.currentSelection.elem |
| 376 | this.currentSelection.elem.scrollIntoView({ block: "nearest" }) |
| 377 | } else { |
| 378 | this.selectFirstFile() |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | highlightModelAtPosition(e) { |
| 383 | let elem = document.elementFromPoint(e.clientX, e.clientY) |
no test coverage detected