Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Accessibility Panel #87

Merged
9 changes: 9 additions & 0 deletions lib/accessibility-element-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ class AccessibilityElementView extends SelectableView {

render () {
this.selectorPath.textContent = this.path

// Add a click-handler that will select the element
this.selectorPath.onclick = (evt) => {
evt.preventDefault()
chrome.devtools.inspectedWindow.eval(
"inspect($$(\"" + this.path.replace('"', '\\"') + "\")[0])",
function(result, isException) { }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a internal helper that is promise-based instead of callback-based you might want to use here.

https://github.com/electron/devtron/blob/master/lib/eval.js#L4

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I missed that 😊 . Fixed

);
}
}

filter (searchText) {
Expand Down
7 changes: 7 additions & 0 deletions static/devtron.css
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,13 @@ tbody:focus,
padding-left: 45px;
}

.row-element-path a {
cursor: pointer;
}
tr.active .row-element-path a {
color: white;
}

.active .sidebar-icon {
background-color: white;
}
Expand Down
2 changes: 1 addition & 1 deletion static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
<td></td>
<td></td>
<td class="row-element-path">
<span data-field="selectorPath"></span>
<a data-field="selectorPath" href="#"></a>
</td>
</tr>
</template>
Expand Down