| // Copyright 2020 the V8 project authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| import {FocusEvent} from '../events.mjs'; |
| import {DOM, V8CustomElement} from '../helper.mjs'; |
| './map-panel/map-details', |
| (templateText) => class MapDetails extends V8CustomElement { |
| this._filePositionNode.onclick = e => this._handleFilePositionClick(e); |
| return this.$('#mapDetails'); |
| get _filePositionNode() { |
| return this.$('#filePositionNode'); |
| if (this._map === map) return; |
| let clickableDetails = ''; |
| clickableDetails = `ID: ${this._map.id}`; |
| clickableDetails += `\nSource location: ${this._map.filePosition}`; |
| details = this._map.description; |
| this._filePositionNode.innerText = clickableDetails; |
| this._filePositionNode.classList.add('clickable'); |
| this._mapDetails.innerText = details; |
| _handleFilePositionClick(event) { |
| this.dispatchEvent(new FocusEvent(this._map.sourcePosition)); |