[mod] tidy

This commit is contained in:
Andy Bunce 2025-10-07 17:23:32 +01:00
parent b0e18a87ac
commit 529b57d628
8 changed files with 19 additions and 29 deletions

View file

@ -172,7 +172,7 @@
<button type="button" class="btn-close" aria-label="Close"
onclick="$('popHelp').hidePopover(); "></button>
</header>
<div id=popHelpInfo" class="modal-body">
<div id="popHelpInfo" class="modal-body">
TODO
</div>
<div class="modal-footer">

View file

@ -30,18 +30,7 @@ class ListComponent extends HTMLElement {
get data() {
return this.#data;
}
select(e) {
this.#shadow.querySelectorAll('li.selected').forEach(item => { item.className = ''; });
e.currentTarget.className = 'selected';
console.log('Item clicked:', item, listItem);
// You can dispatch a custom event here if needed.
this.dispatchEvent(new CustomEvent('itemSelected', {
detail: item,
bubbles: true,
composed: true
}));
}
/* Render the list items #data */
render() {
const list = document.createElement('ul');
@ -52,10 +41,10 @@ class ListComponent extends HTMLElement {
this.#shadow.querySelectorAll('li.selected').forEach(item => { item.className = ''; });
e.currentTarget.className = 'selected';
const i=e.currentTarget.getAttribute("data-index")
console.log('Item index clicked:', i);
console.log('Item index clicked:', i,this.#data[i]);
// You can dispatch a custom event here if needed.
this.dispatchEvent(new CustomEvent('itemSelected', {
detail: i,
detail: this.#data[i],
bubbles: true,
composed: true
}));
@ -76,7 +65,8 @@ class ListComponent extends HTMLElement {
const style = document.createElement('style');
style.textContent = `
@import url("../codicon@0.0.40/codicon.css");
ul { list-style-type: none; padding:0;margin:0; }
ul { list-style-type: none; padding:0;margin:0;max-height:80cqh;overflow: auto;
background-color: #f8f9fa;font-size: 80%;}
li { padding: 0 0 0 2px; border-bottom: 1px solid #ccc; cursor: pointer; width:100%; }
li:not(.selected) :hover { background-color: #ccc; }
.selected { background-color: #0d6efd;color: #ffff;}

View file

@ -93,9 +93,9 @@ $("cmd").onclick = e => {
};
$("symList").onclick = e => {
console.log("SYM CLICK");
};
$("symList").addEventListener("itemSelected", e => {
console.log("SYM itemSelected",e.detail);
});
$("lint").onclick = async e => {
console.log("word", view.state.wordAt(1));