diff --git a/tools/system-analyzer/index.css b/tools/system-analyzer/index.css index 6809475b6b..27b07531bf 100644 --- a/tools/system-analyzer/index.css +++ b/tools/system-analyzer/index.css @@ -164,6 +164,11 @@ dd { background-color: var(--border-color); } +.panel > .selection select { + flex: 1; + width: 50%; +} + button { cursor: pointer; } diff --git a/tools/system-analyzer/index.html b/tools/system-analyzer/index.html index 4c4f7e01bd..fa09830240 100644 --- a/tools/system-analyzer/index.html +++ b/tools/system-analyzer/index.html @@ -21,7 +21,6 @@ found in the LICENSE file. --> globalThis.app = new module.App(); })(); -

Code Panel

- +
+ + +

Disassembly


diff --git a/tools/system-analyzer/view/code-panel.mjs b/tools/system-analyzer/view/code-panel.mjs
index 9e188e4e1b..3b5261e03c 100644
--- a/tools/system-analyzer/view/code-panel.mjs
+++ b/tools/system-analyzer/view/code-panel.mjs
@@ -17,6 +17,8 @@ DOM.defineCustomElement('view/code-panel',
   constructor() {
     super(templateText);
     this._codeSelectNode.onchange = this._handleSelectCode.bind(this);
+    this.$('#selectedRelatedButton').onclick =
+        this._handleSelectRelated.bind(this)
   }
 
   set timeline(timeline) {
@@ -68,7 +70,13 @@ DOM.defineCustomElement('view/code-panel',
       select.add(option);
     }
   }
+
   _handleSelectCode() {
     this.entry = this._codeSelectNode.selectedOptions[0].data;
   }
+
+  _handleSelectRelated(e) {
+    if (!this._entry) return;
+    this.dispatchEvent(new SelectRelatedEvent(this._entry));
+  }
 });
\ No newline at end of file
diff --git a/tools/system-analyzer/view/source-panel-template.html b/tools/system-analyzer/view/script-panel-template.html
similarity index 96%
rename from tools/system-analyzer/view/source-panel-template.html
rename to tools/system-analyzer/view/script-panel-template.html
index 02b8e2695d..27fd3d83eb 100644
--- a/tools/system-analyzer/view/source-panel-template.html
+++ b/tools/system-analyzer/view/script-panel-template.html
@@ -59,10 +59,6 @@ found in the LICENSE file. -->
       box-shadow: 0px 0px 0px 0px var(--secondary-color);
     }
   }
-  .selection select {
-    flex: 1;
-    width:50%;
-  }
 
 

Source Panel

diff --git a/tools/system-analyzer/view/source-panel.mjs b/tools/system-analyzer/view/script-panel.mjs similarity index 96% rename from tools/system-analyzer/view/source-panel.mjs rename to tools/system-analyzer/view/script-panel.mjs index 93db9aa000..f0be519b7a 100644 --- a/tools/system-analyzer/view/source-panel.mjs +++ b/tools/system-analyzer/view/script-panel.mjs @@ -6,7 +6,7 @@ import {groupBy} from '../helper.mjs'; import {SelectRelatedEvent, ToolTipEvent} from './events.mjs'; import {delay, DOM, formatBytes, V8CustomElement} from './helper.mjs'; -DOM.defineCustomElement('view/source-panel', +DOM.defineCustomElement('view/script-panel', (templateText) => class SourcePanel extends V8CustomElement { _selectedSourcePositions = []; @@ -18,11 +18,8 @@ DOM.defineCustomElement('view/source-panel', super(templateText); this.scriptDropdown.addEventListener( 'change', e => this._handleSelectScript(e)); - this.$('#selectedRelatedButton').onclick = (e) => { - if (this._script) { - this.dispatchEvent(new SelectRelatedEvent(this._script)); - } - } + this.$('#selectedRelatedButton').onclick = + this._handleSelectRelated.bind(this); } get script() { @@ -121,6 +118,11 @@ DOM.defineCustomElement('view/source-panel', this.script = option.script; } + _handleSelectRelated(e) { + if (!this._script) return; + this.dispatchEvent(new SelectRelatedEvent(this._script)); + } + handleSourcePositionClick(e) { const sourcePosition = e.target.sourcePosition; this.dispatchEvent(new SelectRelatedEvent(sourcePosition));